This code demonstrates an application of kalman filter for getting the unobservable process.
Intially, series of values are geneated for the 2 processes (observable and unobservable) using the state space equations:
% State space reprsentation to be forcasted by kalman filter
% zhi(t+1) = F*zhi(t) + v(t+1) --> unbobserved varaibles
% v~N(0,Q)
% y(t) = A'*x(t) + H'*zhi(t) + w(t)
% w~N(0,R)
Next, the unobservable process is set aside and rest of all the remaining parameters are fed as input to the kalman filter predictor-corretor algorithm.
At each iteration, the unobserbale process predicted by the filter is noted.
Finally, the graph compares the processes:
Red curve- Original unobesrable process that was used for simulation
Green curve - unobervable process predicted using Kalman filter
Blue curve - observable process
As can be seen, the pupose of Kalman filter in this exercise was to predict the unoservable process green curve and it pretty much moves along with the red curve. Hence Kalman filter is doing a good job in fiding underlying process that was used to generate our observable process.