Pair Trading Lab Helpdesk & Forum

Pair Trading => Good & Bad Pairs => Topic started by: offpista on February 14, 2018, 10:06:01 am

Title: kalman filters
Post by: offpista on February 14, 2018, 10:06:01 am
Hello,

I am new here, I like the site a lot, it has a big value for pair traders.
I have few questions:
1. the backtester, what periods of price it uses? minute data? tick data, daily data...and how's it's fed into the kalman fiters?

2. the kalman fiters grid 2 and auto - can you share your code modifications for each one with this code template? I am using python.

    # y is 1-dimensional, (alpha, beta) is 2-dimensional
    kf = KalmanFilter(n_dim_obs=1, n_dim_state=2,
                      initial_state_mean=np.ones(2),
                      initial_state_covariance=np.ones((2, 2)),
                      transition_matrices=np.eye(2),
                      observation_matrices=obs_mat,
                      observation_covariance=10**3,
                      transition_covariance=0.01**2 * np.eye(2))
thanks
Title: Re: kalman filters
Post by: admin on February 15, 2018, 07:38:07 am
Hello!

1) daily data
2) sorry, Kalman-Grid and Kalman-auto models are proprietary...they use many standalone KFs which follow the reference implementation by Ernesto P Chan http://www.epchan.com/
Title: Re: kalman filters
Post by: admin on February 16, 2018, 01:47:44 am
https://wiki.pairtradinglab.com/wiki/Pair_Trading_Models