State Space Problem Fail to improve likelihood

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

chapman24
Posts: 8
Joined: Mon Jun 22, 2009 10:20 am

State Space Problem Fail to improve likelihood

Postby chapman24 » Mon Jun 22, 2009 10:59 am

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!

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: State Space Problem Fail to improve likelihood

Postby trubador » Mon Jun 22, 2009 12:15 pm

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.

chapman24
Posts: 8
Joined: Mon Jun 22, 2009 10:20 am

Re: State Space Problem Fail to improve likelihood

Postby chapman24 » Tue Jun 23, 2009 7:10 am

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?

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: State Space Problem Fail to improve likelihood

Postby startz » Tue Jun 23, 2009 7:29 am

On the off chance this was unintentional, let me ask: do you mean to force the equations to have equal variances?

chapman24
Posts: 8
Joined: Mon Jun 22, 2009 10:20 am

Re: State Space Problem Fail to improve likelihood

Postby chapman24 » Tue Jun 23, 2009 8:43 am

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.

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: State Space Problem Fail to improve likelihood

Postby startz » Tue Jun 23, 2009 9:51 am

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)).

desicastrillo
Posts: 1
Joined: Fri Aug 14, 2009 9:27 am

Re: State Space Problem Fail to improve likelihood

Postby desicastrillo » Fri Aug 14, 2009 9:48 am

Hi

I am programming with Kalman filter inflation expectations. Somebody did that?

Regards


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest