Page 1 of 1
State Space Problem Fail to improve likelihood
Posted: Mon Jun 22, 2009 10:59 am
by chapman24
Hi,
I wrote a state space program, it runs, but keep on telling me failure to improve likelihood after .... iterations.
Here is my program:
@signal pi = sv4
@signal y = sv5 + sv2
@state sv1 = (1-c(5))*0.0125 + c(5)*sv1(-1) + [var = 1]
@state sv2 = c(6)*sv2(-1) + c(7) *r +c(8) *di + c(9)*reer + [var = 1]
@state sv3 = sv2(-1)
@state sv4 = c(1)*sv4(-1) + c(2)*sv3(-1) + c(3)*sv2(-1)+ c(4)*reer + [var = 1]
@state sv5 = sv5(-1) + sv1(-1) + [var = 1]
Could anybody tell me why it fails to converge? Really appreciated!
Re: State Space Problem Fail to improve likelihood
Posted: Mon Jun 22, 2009 12:15 pm
by trubador
Your model seems to be ill-defined. Could you please search the forum for discussions on the commonly encountered problems in state space modeling (or kalman filtering) in EViews? You'll find useful explanations and some suggestions. And please keep in mind that state space modeling is not like estimating an OLS, since it has a highly dynamic structure and deals with unobserved variables. Therefore, you should not expect to obtain feasible results each time you run it.
Re: State Space Problem Fail to improve likelihood
Posted: Tue Jun 23, 2009 7:10 am
by chapman24
Thank you for your reply. I made a little change and now it can converge
param c(1) .77 c(2) .37 c(3) .59 c(4) .43 c(5) -.03 c(6) .21 c(7) -.08 c(8) .19 c(9) .02 c(10) 7.0
@signal y = sv2 + sv5
@signal pi = sv4
@state sv1 = (1-c(1))*0.0125 + c(1)*sv1(-1) + [var = exp(c(10))]
@state sv2 = c(2)*sv2(-1) + c(3) *r/100 +c(4) *di + c(5)*reer + [var = exp(c(10))]
@state sv3 = sv4(-1)
@state sv4 = c(6)*sv4(-1) + c(6)*sv3(-1) + c(8)*sv2(-1)+ c(9)*reer + [var = exp(c(10))]
@state sv5 = sv5(-1) + sv1(-1) + [var = exp(c(10))]
and this is the output
Sspace: STATE
Method: Maximum likelihood (Marquardt)
Date: 06/23/09 Time: 09:51
Sample: 1988Q2 2008Q4
Included observations: 82
Estimation settings: tol= 1.0e-05, derivs=accurate numeric
Initial Values: C(1)=0.77000, C(2)=0.37000, C(3)=0.59000, C(4)=0.43000,
C(5)=-0.03000, C(6)=0.21000, C(8)=0.19000, C(9)=0.02000,
C(10)=7.00000
Convergence achieved after 12 iterations
Coefficient Std. Error z-Statistic Prob.
C(1) -0.173819 0.000120 -1451.262 0.0000
C(2) 0.478490 0.003080 155.3389 0.0000
C(3) 0.074744 0.007506 9.957473 0.0000
C(4) 0.001925 0.000444 4.334568 0.0000
C(5) 0.095388 0.060860 1.567350 0.1170
C(6) 0.377823 0.007360 51.33206 0.0000
C(8) 0.382042 0.000704 542.8233 0.0000
C(9) -0.165112 0.018163 -9.090374 0.0000
C(10) -7.959525 0.038437 -207.0784 0.0000
Final State Root MSE z-Statistic Prob.
SV1 0.011809 0.018976 0.622301 0.5337
SV2 -0.061637 0.020724 -2.974194 0.0029
SV3 0.017531 0.000000 NA 0.0000
SV4 0.024085 0.020010 1.203640 0.2287
SV5 10.63329 0.032064 331.6294 0.0000
Log likelihood 310.9012 Akaike info criterion -7.363443
Parameters 9 Schwarz criterion -7.099291
Diffuse priors 5 Hannan-Quinn criter. -7.257390
But I still have some questions to ask you if you don't mind.
1. C(1) should be bewteen 0 and 1, but the estimation is negative. Is there a way to set constraint in the state space model?
2. In the fourth state equation: @state sv4 = c(6)*sv4(-1) + c(6)*sv3(-1) + c(8)*sv2(-1)+ c(9)*reer + [var = exp(c(10))]
what I really need is @state sv4 = c(6)*sv4(-1) + c(7)*sv3(-1) + c(8)*sv2(-1)+ c(9)*reer + [var = exp(c(10))]
but it fails to converge if I include c(7). Is it because there are too many coefficients to estimate?
Re: State Space Problem Fail to improve likelihood
Posted: Tue Jun 23, 2009 7:29 am
by startz
On the off chance this was unintentional, let me ask: do you mean to force the equations to have equal variances?
Re: State Space Problem Fail to improve likelihood
Posted: Tue Jun 23, 2009 8:43 am
by chapman24
Yes, they represent the shocks to the dependent variables. In the model, these shocks are assumed to be i.i.d.
Ideally, I would like to specify them all to have a variance of 1, but the program will not converge. Making a variance as exp(c(10)) seems to be the only way to have the program converge. Thanks.
Re: State Space Problem Fail to improve likelihood
Posted: Tue Jun 23, 2009 9:51 am
by startz
Assuming equal variances is very unusual, but there's certainly nothing wrong with doing so.
Noting that your estimates wildly reject a positive c(1), you could nonetheless constrain it to be positive by replacing c(1) with exp(c(1)).
Re: State Space Problem Fail to improve likelihood
Posted: Fri Aug 14, 2009 9:48 am
by desicastrillo
Hi
I am programming with Kalman filter inflation expectations. Somebody did that?
Regards