Page 1 of 1

State Space Modeling Issues

Posted: Sat Aug 14, 2010 5:44 am
by alfernz
Hello,

I am new to Eviews and would greatly appreciate any help with the following query.

I purchased Eviews last week based on the software's ability to perform State Space modeling. However, I could only afford the basic student package - version 6. I note that there are certain limits on the student version - notably a maximum of 10 equations. Perhaps this limitation is to blame for the trouble I am having in my problem which I have detailed below?

Basically, I am estimating a simple economic demography model involving birth rates, death rates and real wages. Here is my code:

Code: Select all

@signal lws = c(1)*lpop + sv1 + sv2 @state sv1 = sv1(-1) + sv3(-1) @state sv3 = sv3(-1) + [var=exp(c(2))] @state sv2 = c(4)*sv2(-1) + c(5)*sv4(-1) + [var=exp(c(3))] @state sv4 = sv2(-1) @signal deathrate = sv5 + c(6)*(lws(-1) + dlws) + c(7)*lws(-1) + c(8)*lws(-2) + c(9)*lws(-3) + c(10)*lws(-4) + sv6 @state sv5 = sv5(-1) + [var=exp(c(11))] @state sv6 = c(12)*sv6(-1) + c(13)*sv7(-1) + [var=exp(c(14))] @state sv7 = sv6(-1) @signal birthrate = sv8 + c(15)*(lws(-1) + dlws) + c(16)*lws(-1) + c(17)*lws(-2) + c(18)*lws(-3) + c(19)*lws(-4) + sv9 @state sv8 = sv8(-1) + [var=exp(c(20))] @state sv9 = c(21)*sv9(-1) + c(22)*sv10(-1) + [var=exp(c(23))] @state sv10 = sv9(-1) @param c(1) -1.7 c(2) -12.0 c(3) -4.9 c(4) 0.74 c(5) -0.19 c(6) -0.53 c(7) -6.26 c(8) 0.3 c(9) 3.6 c(10) 0.896 c(11) -15.707 c(12) 0.545 c(13) -0.091 c(14) -11.396 c(15) 10.531 c(16) -6.174 c(17) 1.689 c(18) -0.73 c(19) -1.89 c(20) -15.016 c(21) 0.495 c(22) 0 c(23) -13.073
Firstly, I ran the model (which perhaps needs to be changed) without the initial parameters (@param) being specified. The result being great difficulty converging. Therefore I selected the initial parameter values from what has been found previously in the literature. However my results this time were very strange. The model converged after one iteration to the initial values. I cleared the open work file after each estimation.

Would anybody be able to tell me whether these issues are due to the student version being used or is there something else which needs to be corrected please? This model has previously been estimated in the literature - so it is somewhat puzzling why I am having so much trouble with it.

Thanks

Alan

Re: State Space Modeling Issues

Posted: Mon Aug 16, 2010 5:57 am
by trubador
Could you please post your workfile? However, I would suggest not to expect much, since there can be a number of reasons to fail to successfully estimate a State Space model.

Re: State Space Modeling Issues

Posted: Mon Aug 16, 2010 6:16 am
by alfernz
Thanks, hopefully this loads!

Alan

Re: State Space Modeling Issues

Posted: Mon Aug 16, 2010 8:04 am
by trubador
First of all, you may be experiencing degrees-of-freedom problem, since the number of estimated parameters is high. Increasing the number of your observations or reducing the number of your state variables/coefficients might help. Moreover, it seems sv5 and sv8 need not be defined as random walk. Therefore you can either replace the state specifications with fixed coefficents or just drop the variance terms. Gathering the starting values of coefficents from literature might not help, since these values can be very data dependent. I suggest you to estimate these relationships with OLS first, and then use the results as inputs to your state space estimation. Finally, you may need to initialize the mean and variance values of state variables to ease the convergence.

Re: State Space Modeling Issues

Posted: Mon Aug 16, 2010 9:30 am
by alfernz
@Trubador

Thanks for the help -- very much appreciated.

I will try to make my model more parsimonious. I agree with your point on the random walks in the deathrate equation -- as my data indicate this is I(0). However, I would like to include a RW in the birthrate equation because this corresponds to economic theory and historical evidence. This equation is I(1) which fits in with what we know about urbanization and the costs of children etc.

I understand your other points about parameter initialization and of course it makes sense. Would a better approximation of these values be for me to perform an estimation of the 3 state variables separately? ie. just estimate:

Code: Select all

@signal lws = c(1)*lpop + sv1 + sv2 @state sv1 = sv1(-1) + sv3(-1) @state sv3 = sv3(-1) + [var=exp(c(2))] @state sv2 = c(4)*sv2(-1) + c(5)*sv4(-1) + [var=exp(c(3))] @state sv4 = sv2(-1)
estimate and follow it with:

Code: Select all

@signal deathrate = sv5 + c(6)*(lws(-1) + dlws) + c(7)*lws(-1) + c(8)*lws(-2) + c(9)*lws(-3) + c(10)*lws(-4) + sv6 @state sv5 = sv5(-1) + [var=exp(c(11))] @state sv6 = c(12)*sv6(-1) + c(13)*sv7(-1) + [var=exp(c(14))] @state sv7 = sv6(-1)
I have briefly looked at this and the results look and seem sensible enough. In addition, the models converge within 30 iterations. Which is why I think that the issue may lie in the fact that my version of Eviews only supports 10 equations -- however since there are only 3 state eqs this might be OK, or is it? Which is really the main issue I am struggling with -- is my version of Eviews able to handle this many equations?

Thanks again,

Alan

Re: State Space Modeling Issues

Posted: Mon Aug 16, 2010 10:17 am
by EViews Glenn
The number of equation limit in the Student Version is, I believe, for systems of equations and not for state space. If you were reaching the limit you would have encountered a specific error message to that effect.

Re: State Space Modeling Issues

Posted: Mon Aug 16, 2010 10:26 am
by EViews Gareth
Just to clarify Glenn's answer - I believe the student version limit is actually on Model objects, not Systems or StateSpace.

Re: State Space Modeling Issues

Posted: Mon Aug 16, 2010 1:56 pm
by EViews Glenn
Gareth post was a polite way of "correcting", not "clarifying". Thanks.

Re: State Space Modeling Issues

Posted: Tue Aug 17, 2010 12:25 am
by trubador
Would a better approximation of these values be for me to perform an estimation of the 3 state variables separately?
No, you should stick to the joint estimation of your parameters.
For a better initialization, you can estimate an OLS (e.g. for deathrate) beforehand:

Code: Select all

coef(8) dr equation eq_dr.ls deathrate = dr(1) + dr(2)*(lws(-1) + dlws) + dr(3)*lws(-1) + dr(4)*lws(-2) + dr(5)*lws(-3) + dr(6)*lws(-4) + [ar(1)=dr(7),ar(2)=dr(8)]
And then you can use the estimated parameter values as starting values for your state space equation. For instance, c(6) to c(10) can be initialized with dr(2) to dr(6), while dr(7) and dr(8) could be a good approximation for c(12) and c(13), accordingly. On the other hand, dr(1) can be the initial value (mean) of state variable sv5, which you need to use @mprior to accomplish that (please the users guide for details).

Re: State Space Modeling Issues

Posted: Tue Aug 17, 2010 7:11 am
by alfernz
Hi again guys,

I really appreciate all the help you have given me so far. Its good to know that my version of Eviews supports the model I want to estimate. Unfortunately, I don't seem to be able to get the model to converge to a singular covariance matrix. I will describe the steps I have taken, which I am willing to be corrected on. Please find my workfile attached.

(1) I estimated the 3 state equations via OLS and used coeffs as initial values in the SS formulation. For reasons of parsimony, I only include the significant lagged variables in my state space formulation.
(2) The initial values of the variance coefficients are not specified.
(3) I also used the intercept terms of the OLS regressions as the initial state intercept terms - two of which (lws and birthrate) are random walks.
(4) All other state variables start at zero.
(5) The state covariance matrix is the 8*8 identity matrix.

After I perform these steps there is no joy. Should any of the above steps be changed and/or are there any additional steps I should take?

Thanks again,

Alan

Re: State Space Modeling Issues

Posted: Mon Aug 23, 2010 3:20 am
by alfernz
Hi,

I just thought I would bump this to see if anybody can help me with the above -- even if its to say they cant. I am still struggling.

Thanks.

Re: State Space Modeling Issues

Posted: Wed Aug 25, 2010 5:37 am
by alfernz
Hi again guys,

Just some quick questions which are related to the above, which hopefully somebody can explain to me.

Please find my workfile attached.

Here you can see that there are two state space models (ss02 and ss02a) which are identical. However, the results I have obtained when estimating are far different.

In ss02 the results make perfect sense. However, in ss02a the standard errors are huge, despite the model being exactly the same syntax.

Would anybody have any idea why the output is so different despite the syntax being the same?

Any help would be greatly appreciated.

Alan

Re: State Space Modeling Issues

Posted: Wed Aug 25, 2010 6:53 am
by startz
On difference is the different starting values. You also have some other different estimation settings.

Re: State Space Modeling Issues

Posted: Wed Aug 25, 2010 7:11 am
by alfernz
Thanks for the response Starz.

I have been adjusting the starting values and it seems that estimation is very, very sensitive to which starting values I was choosing for my variance terms.

Seems like I have that sorted.

Thanks,

Alan