1
$\begingroup$

I'm working on a forecasting model. The standard form for it is:

$y_t=\Lambda^*f_t+u_t\\f_t=A_1f_{t-1}+...+A_pf_{t-p}+e_t$

where $f_t$ is a vector of factors obtained from Principal Component Analysis that follows some VAR(p) dynamics. I have no problem with the PCA or the VAR estimation in my dataset, but I struggle with getting the Kalman filter right. I am trying to use R's dlm function, but the standard model specification there is:

$y_t=F^*f_t+u_t\\f_t=Gf_{t-1}+e_t$

I am aware that the dlm function should allow me to specify any dynamic I want for the factors to follow, as already mentioned in an answer on CV here, but I can't work out how to do that - do I create a block matrix with $A_1, ..., A_p$ blocks on the diagonal? If so, how do I then estimate the variance-covariance matrix (call it $E$) using the residuals from my VAR? How can I make the dimensions work? It seems to me that $E$ can only be a $k\times k$, where $k\times1$ is the dimension of $f_t$...

$\endgroup$
2
$\begingroup$

Package dlm provides the function dlmModARMA, which creates a state space representation of a specific univariate or multivariate ARMA model. What you get using this function is a model in which your observations are exactly the f_t. If you want a factor model, then you have to redefine the observation matrix F and the observation variance V.

Best, Giovanni

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.