I am looking out for some material where I can study about Kalman Filter applied to Equity using Excel or R?
3 Answers
A great example of kalman filtering is in the Kyle Model. I have attached a presentation on the application of R to the kalman filter in the Kyle Model.
http://www.rinfinance.com/RinFinance2009/presentations/microstructure-tutorial.pdf
Basically in the Kyle Model, a market maker finds the likelihood an asset is ending up at a certain price given that a person is an informed trader. Given this, you update what the final price will be by each successive trade through a kalman filter
-
$\begingroup$ Thanks for your suggestion it seems like the link mentioned here is for microstructure-tutorial and not for kalman filter. Can you please share link for Kalman Filter. $\endgroup$– AddCommented Dec 15, 2012 at 14:22
-
$\begingroup$ a Kalman Filter is built into the Kyle-model. Implementing the settings for the kyle model will give you a great example of how some market makers actually trade as well as some intuition of real financial markets using kalman filter $\endgroup$– AndrewCommented Dec 17, 2012 at 15:01
A simple google search should get your started:
I like this one the best because it compares different packages:
and here couple more:
- http://www.r-bloggers.com/the-kalman-filter-for-financial-time-series/
- http://cran.r-project.org/web/packages/dlm/index.html
- http://cran.r-project.org/web/packages/FKF/index.html
- http://cran.r-project.org/web/packages/KFAS/index.html
- http://cran.r-project.org/web/packages/schwartz97/index.html
- http://www.jstatsoft.org/v41/i04
But I highly recommend you to also read up on unscented kalman filters and particle filters because they are much more applicable to financial time series (handle non-normality):
- http://en.wikipedia.org/wiki/Kalman_filter
- http://signal.hut.fi/kurssit/s884221/ukf.pdf
- http://en.wikipedia.org/wiki/Particle_filter
- http://user.uni-frankfurt.de/~muehlich/sci/TalkBucurestiMar2003.pdf
- http://perso.uclouvain.be/michel.verleysen/papers/ffm07sd2.pdf
- http://www2.mccombs.utexas.edu/faculty/carlos.carvalho/teaching/lopes-tsay-2010.pdf
-
$\begingroup$ Some great resources there. I think I have a vague sense of how the particle filter works, but I don't find it very intuitive. That March 2003 talk says that PF is best for multi-modal or skewed pdfs (implying that EKF or UKF might be better otherwise). Any insight if you only want to use a Kalman filter with t distributed errors? $\endgroup$– JohnCommented Dec 6, 2012 at 15:34
-
$\begingroup$ well my point was that a Kalman filter makes the assumption of normally distributed error terms and also that the equation must be linear (linear dynamic system) which is not in agreement with empirical evidence gathered from analyzing financial time series data. I remember there was a youtube lecture video implementing a particle filter on stock time series, estimating highs and lows for a momentum based strategy. A quick search did not get me anything. If I find it later then I will post the link $\endgroup$ Commented Dec 6, 2012 at 15:48
-
$\begingroup$ I read a bit about how to use Particle Filters for on line Bayesian estimation. Don't understand all the math yet, but that might be a good enough reason to use them. $\endgroup$– JohnCommented Dec 7, 2012 at 22:40
The following paper gives you a step-by-step presentation of how to use the Kalman filter in an application in a pricing model framework for a spot and futures market. Everything is explained using Excel: