stefan-jansen / machine-learning-for-trading

Code for Machine Learning for Algorithmic Trading, 2nd edition.
https://ml4trading.io
13.22k stars 4.18k forks source link

Kalman Filter and denoising #244

Closed ghost closed 2 years ago

ghost commented 2 years ago

The example in denoising data with Kalman Filter seems that is not applied properly. The initial value is odd (relates to the guess? )

https://github.com/stefan-jansen/machine-learning-for-trading/blob/main/04_alpha_factor_research/03_kalman_filter_and_wavelets.ipynb

Here is the pic from the book (second version, Kindle edition)

image

deven13j commented 2 years ago

It was proper as initial_state_mean taken as 0, if you want to start your Kalman Filter guess with your initial measurement then your can change initial_state_mean (in this example approximately 1410)

stefan-jansen commented 2 years ago

Thanks, closing for now, please feel free to reopen if you have further questions.