Nowcasting icon indicating copy to clipboard operation
Nowcasting copied to clipboard

No update for the Initial State Covariance Matrix V_0

Open victorbluhu opened this issue 4 years ago • 3 comments

I believe that in line 243 of the dfm.m file the EMstep function should return V_0_new and not V_0. Due to this typo, the initial state covariance matrix is not updated in the algorithm. It does not seem to affect estimations by a lot, but we are leaving loglikelihood on the table.

victorbluhu avatar Jun 08 '20 14:06 victorbluhu

HI @victorbluhu ,

This is not a typo. According to the function's documentation, this is expected

https://github.com/FRBNY-TimeSeriesAnalysis/Nowcasting/blob/19f365cab8269e3aac3faa11ad091d6e913c5c43/functions/dfm.m#L244-L292

MajesticKhan avatar Jun 27 '20 14:06 MajesticKhan

Hi @MajesticKhan , sorry for the very late response.

Even though the code states "initial value of ____" (state / covariance matrix), they do update the Z_0 value with the smoothed post-Kalman Filter values Zsmooth(:,1) (as you may see in lines 312 (KF filter-smoother) and 403 (Z_0 update)). The Z_0 in the output is different from the Z_0 in the input.

As I mentioned in the OP, that is not the case for the covariance matrix V_0. We copy V_0 to V_0_new (line 321), update V_0_new (lines 365 and 397), but discard it all together.

I believe the funcion's documentation is already contradicted by the code and should not be considered as decisive evidence.

https://github.com/FRBNY-TimeSeriesAnalysis/Nowcasting/blob/19f365cab8269e3aac3faa11ad091d6e913c5c43/functions/dfm.m#L308-L403

victorbluhu avatar Nov 04 '20 13:11 victorbluhu

@victorbluhu No need to apologize!

Yes, I agree with you. In fact I made a post about this earlier lol. Check this issue

@eric-qian @bbok can you please clarify this issue? Thank you!

MajesticKhan avatar Nov 04 '20 14:11 MajesticKhan