# Kalman filtering

Is it possible to the extract the latent factor f from the following equations using kalman smoothing?

f is the unobserved state value while z is observed series.

From the literature i could read on web mostly the variable in state equation is a function of its previous one lag however here its a function of the last three lags.

Please, can you suggest some literature to understand the computation part and also would like to know which packages in R can be useful to implement this problem in particular

Link to original paper, refer to page 6

• Hi @user16068 and welcome to quant.SE. Could you register, please? moreover, could you edit the post posting some reference about the question? Where did you find the state equation with 3 lags? – Quantopik Apr 28 '15 at 8:47

In the paper you cited in the question, the equation (1) is not the equation of state in kalman filter model, but an $AR(3)$ estimated via OLS as shown in Stock & Watson (2002).

What the authors estimated in the paper using the Kalman filter is the latent variables $f_t,_h$ and the relative lags through which they estimated both the equation (1) and (2).

The number of lags is chosen on the basis of the value of Akaike Information Criterion and, in this case, they choose 3 lags. Keep in mind there are other way to estimate the correct number of lags and it depends on several factors as, for instance, the kind of data, the frequency, the underlying model, etc.

Moreover, they suggested that such equations can be estimated via PC analysis too.

Instead, as regards the R package you need for implementing and replicating this model, there exist 2 main packages available in R:

Moreover, for general references look at:

Tusell, Fernando. "Kalman filtering in R." Journal of Statistical Software 39.2 (2011): 1-27.

It is not about estimating those equations via PC. There are various methods to estimate the latent factor fth, one of which is principal components. They have asked us to use that. Series(z) in those equations is observed data so we use the estimated fth and observed z to perform the OLS as suggested

AR(3) or ARMA(1,0,3) would make the residual series independent (not auto correlated). So i guess its been used for that reason

If the given equations are not the state space equations why have they asked us to estimate the residual covariance matrix for innovations in both equations via OLS and suggested to use the same for kalman filtering/smoothing

It doesn't make sense to estimate residual covariance matrix on a AR(3) process and then use the same the AR(1) state equation while performing Kalman smoothing