sstoikov / microprice

346 stars 94 forks source link

Dimension of Matrices #3

Closed letian-w closed 3 years ago

letian-w commented 3 years ago

In cell 7 of the notebook, the estimate function is defined as the following.

def estimate(T):

    # LINES OMMITED

    Q_counts=np.resize(np.array(no_move_counts[0:(n_imb*n_imb)]),(n_imb,n_imb))
    # loop over all spreads and add block matrices
    for i in range(1,n_spread):
        Qi=np.resize(np.array(no_move_counts[(i*n_imb*n_imb):(i+1)*(n_imb*n_imb)]),(n_imb,n_imb))
        Q_counts=block_diag(Q_counts,Qi)

    # LINES OMMITED

    return G1,B,Q,Q2,R1,R2,K

Should this be n_imb*n_spread instead of n_imb*n_imb? In the paper, matrix Q is of dimension nm by nm, where n and m are discretized grids of I and S respectively.

sstoikov commented 3 years ago

In the end of the loop the Q matrix is of size n_imbn_spread by n_imbn_spread

It is made up of n_spread blocks of n_imb by n_imb matrices

On Wed, Sep 15, 2021 at 12:24 AM Letian Wang @.***> wrote:

In cell 7 of the notebook https://github.com/sstoikov/microprice/blob/master/Microprice%20-%20Big%20Data%20Conference.ipynb, the estimate function is defined as the following.

def estimate(T):

# LINES OMMITED

Q_counts=np.resize(np.array(no_move_counts[0:(n_imb*n_imb)]),(n_imb,n_imb))
# loop over all spreads and add block matrices
for i in range(1,n_spread):
    Qi=np.resize(np.array(no_move_counts[(i*n_imb*n_imb):(i+1)*(n_imb*n_imb)]),(n_imb,n_imb))
    Q_counts=block_diag(Q_counts,Qi)

# LINES OMMITED

return G1,B,Q,Q2,R1,R2,K

Should this be n_imbn_spread instead of n_imbn_imb? In the paper https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2970694, matrix Q is of dimension nm by nm, where n and m are discretized grids of I and S respectively.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sstoikov/microprice/issues/3, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFLPYTYKMPC5IIL3PHFO2DUCANYDANCNFSM5EBRIXFQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

letian-w commented 3 years ago

Got it, thank you @sstoikov. That was my oversight.