DLM, TVC and GAP

Discussion of State Space and Dynamic Stochastic General Equilibrium Models
fioramanti
Posts: 27
Joined: Thu Feb 18, 2016 4:44 am

DLM, TVC and GAP

Unread post by fioramanti »

Dear Tom,
Based on SSM course 2.0, I'm currently trying to adapt your version of the Matheson & Stavrev (2013) time varying coefficients to (a simplified version of - no ugap lags in the Phillips Curve) GAP. In particular I started by changing (as least as possible) the constrained version of your “rpf” (ekfconstrain.rpf).
The UCM is: trend is a second order RW (LLT), Cycle is AR(2) and the Phillips Curve is like in M&S, i.e. with no lags in unemployment gap. Data are annual.
I get really weird behaviours of the TVCs. Furthermore, it is really not clear to me what the new DLM options ‘fspost’ do.
Attached you can find the files for the estimation. Do you have any hint on where my code is not correct or can be improved/fine tuned?
Attached data and programs.

Thanks,
M
Attachments
Constrained TVC.zip
(9.85 KiB) Downloaded 822 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: DLM, TVC and GAP

Unread post by TomDoan »

What is "mi"? I'm not going to try to back your model out of a RATS program. Please write it out as formulas.

You should read the correct Simon article (not the one cited, which doesn't do inequality constraints). He gives about a half dozen different methods for doing inequality-constrained filtering (all of which are approximations---there's no closed form solution). The one chosen by the authors is to solve a constrained quadratic program at each step in the filter and to pass the solution to that through as the state mean. That's what the PostFnc is doing---it's taking the filtered xt_t and vt_t , solving the quadratic program and replacing the xt_t (leaving vt_t) as it was. A complication (which isn't discussed in the paper---in fact, virtually none of the technical issues are discussed in the paper) is that the covariance matrix is singular which means that there are multiple constrained solutions. PostFnc replaces the zero eigenvalues with 1 in inverting the matrix, which ends up picking the constrained solution that you would get by substituting out the redundant state.
fioramanti
Posts: 27
Joined: Thu Feb 18, 2016 4:44 am

Re: DLM, TVC and GAP

Unread post by fioramanti »

Thank you Tom,

"mi" is the slope of the trend, which is a second order random walk.

The trend is:
u*(t)=u*(t-1)+mi(t-1)+noise
mi(t)=mi(t-1)+noise

Marco
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: DLM, TVC and GAP

Unread post by TomDoan »

Please write your entire model out.
fioramanti
Posts: 27
Joined: Thu Feb 18, 2016 4:44 am

Re: DLM, TVC and GAP

Unread post by fioramanti »

Ok. The model is:
Attachments
Cattura.PNG
Cattura.PNG (44.52 KiB) Viewed 15961 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: DLM, TVC and GAP

Unread post by TomDoan »

The only thing that appears slightly off about the model is putting the extra zero element into the SWTVC rather than using an F matrix to avoid it. (As you've written it, you should use SWTVC(1)=0.0 rather than SWTCV(1)==0.0 as the first does a straight assignment while the latter allows non-zero values and uses penalty functions to push it towards 0). The cold reality is the TVC's doesn't really change the fact that no one has come up with a GAP-PC model that produces results without them being force-fed into the model through various restrictions.
fioramanti
Posts: 27
Joined: Thu Feb 18, 2016 4:44 am

Re: DLM, TVC and GAP

Unread post by fioramanti »

The cold reality is the TVC's doesn't really change the fact that no one has come up with a GAP-PC model that produces results without them being force-fed into the model through various restrictions.
This is very depressing :(
The only thing that appears slightly off about the model is putting the extra zero element into the SWTVC rather than using an F matrix to avoid it.
What would be a more standard way to put it down? Does it have any effect on the results?

Thanks
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: DLM, TVC and GAP

Unread post by TomDoan »

The only thing that appears slightly off about the model is putting the extra zero element into the SWTVC rather than using an F matrix to avoid it.
What would be a more standard way to put it down? Does it have any effect on the results?
Using an F matrix. The second state, by construction, has no shock. The point of the F matrix is to map shocks to states.
fioramanti
Posts: 27
Joined: Thu Feb 18, 2016 4:44 am

Re: DLM, TVC and GAP

Unread post by fioramanti »

Yes, but if I write A diagonal matrix (F) with 1s on the diagonal but in F(2,2)=0 and I multiply this by a vector sw=swf = swugap~~swtvc, the algebra is the same, isn't it?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: DLM, TVC and GAP

Unread post by TomDoan »

The results will be the same---it just looks wrong to "estimate" a variance which is zero by definition.
Post Reply