IRIS-Solutions-Team / IRIS-Toolbox

[IrisToolbox] for Macroeconomic Modeling
Other
90 stars 41 forks source link

Kalman Filter, Output estimates #395

Open mary-tzaawa-krenzler opened 8 months ago

mary-tzaawa-krenzler commented 8 months ago

Hi Jaromir,

I am using the kalman filter from the IRIS Toolbox to estimate a model. I have two questions:

  1. For further analysis I would like to extract the conditional covariance and variance matrices of the kalman filtered and forecasted unobservable variables. More specifically, I need the following estimates: $Cov(ut, u{T+h} | N^T, W^T)$, where $N^T \equiv (n_1, \dotsc, n_T)$ and $W^T \equiv (w_1, \dotsc, w_T)$ are the sets of observations available on $n_t$ and $w_t$ until time $T$. Further, $nt$ and $n{T=h}$ are jointly normally distributed with variance $V(u_t | N^T, W^T)$ and $Cov(ut, u{T+h} | N^T, W^T)$ which I aim to find in the output structure. Do you by any chance know where it is stored? The Matlab code is the following:

[f,mfilt,filter_info] = kalmanFilter(m1,d,filtrange, 'Override', J, 'output', 'predict,filter,smooth','relative', true);

and for the NN-step predictions:

[f3,m3filt] = kalmanFilter(m1,d,filtrange,'output','pred','ahead',NN,'meanonly',true);

  1. Is it possible to implement Covariance and Variance directly into .model file in the model equations directly?

Thank you very much in advance for your help!