Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

# Estimation and Simulation of State Space (Kalman Filter) Models with Matlab 1.0

Date Added: September 07, 2013  |  Visits: 277

This toolbox was designed to simulate and fit linear state space models. The main literature I used for this particular package is Kim and Nelson (1999). A state space model (without non stochastic coefficients) is given by:y(t)=beta(t)*x(t)'+e(t) beta(t)=u+F*beta(t-1)+v(t)e(t)~N(0,R)v(t)~N(0,Q)Where x(t) is a vector of size (1,k), beta(t), u and v(t) are vectors with size [1,k] and F, Q are matrices of size [k,k]. More details about the model can be found at the reference.The main advantage of this package is that the fitting function lets you build your own state space model by changing the input option optionsSpec. Please check the pdf document and the example scripts at the zip file for instructions of how to use it.Some comments about the fitting code:d-deD? So far it doesnd-deOaot handle autoregressive processes between series of the beta matrix. In other works, at the F matrix, the only estimated coefficients are in the diagonal (all non diagonal elements are zero).d-deD? The model is estimated by Gaussian maximum likelihood with the function fminsearch. I also played around with fminunc(), but there was no improvement over fminsearch when it comes to robustness and speed. d-deD? So far the code doesnd-deOaot handle state space models with mixture of non stochastic and stochastic coefficients, that is, when you want some variables to have stochastic coefficients and others not in the same model. ReferencesKIM, C., J., NELSON, C., R. (1999) d-deDUState Space Model with Regime Switching: Classical and Gibbs-Sampling Approaches with Applicationsd-deDt The MIT press._______________[simSpec_Out]=kalmanSim(nr,Coeff)Function for Simulation of a State Space ModelINPUT: nr - number of observations to be simulated Coeff - Coefficients of the model (check Example_Script_1_Sim for instructions of how to use this input)OUTPUT: simSpec_Out - A structure with the simulated state space series and also the simulated regressors_______________[specOut]=kalmanFit(dep,indep,optionsSpec)Function for Estimation of a state space model by means of kalman filterINPUT: dep - dependent variable indep - independent variable with regressor (aka independent variables) optionsSpec - (optional, default='e'). A options structure for defining your own state space model. Please check the pdf document in the zip file for instruction of how to use. The script Example_Script_2_kalmanFit.m also shows that.OUTPUT: specOut - A structure with the coefficients, final log likelihood, latent variables, among other things.

 Requirements: No special requirements Platforms: Matlab Keyword: Applications,  Approaches,  Classical,  Gibbssampling,  Improvement,  Model,  Modelinput,  Number,  Observations,  Press Simspec Dkalmansimnrcoefffunction,  Regime,  Robustness,  Simulated,  Simulation,  Space,  State,  Switching Users rating: 0/10