State space model convergence

For questions regarding programming in the EViews programming language.

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

student07
Posts: 18
Joined: Tue Jun 03, 2014 5:58 am

State space model convergence

Postby student07 » Sat Mar 14, 2015 10:28 am

I have a similar problem as the poster here:

viewtopic.php?f=4&t=4799

That is: I can successfully estimate the coefficients in the state space model but I keep getting a singular covariance matrix. I used ss01.ml(c = 1e-6) to try to obtain convergence but even that doesn't seem to help.

I also read that it helps to specify initial values using @param but I am not sure how that is done exactly (I cannot find it in the object reference). Also, how could I get plausible initial values?

If that also doesn't work, are there any other things that I can try?

Thanks in advance.

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

Re: State space model convergence

Postby trubador » Sat Mar 14, 2015 12:21 pm


student07
Posts: 18
Joined: Tue Jun 03, 2014 5:58 am

Re: State space model convergence

Postby student07 » Sun Mar 15, 2015 4:05 am

trubador wrote:http://forums.eviews.com/viewtopic.php?f=4&t=2860
viewtopic.php?f=4&t=971
viewtopic.php?f=4&t=4366
viewtopic.php?f=4&t=2770


Thank you very much, especially the first link is very helpful, as I had not found a way to use @param properly yet before.

On that topic you suggest to estimate the initial values by OLS, and I get how you do it for the system that is given there.
The system that I am considering is as follows:

Code: Select all

@signal y = beta0 + beta1*x1 + beta2*x2 + beta3*x3 + [var = exp(c(2))]
@state beta0 = beta0(-1) + [var = exp(c(3))]
@state beta1 = beta1(-1) + [var = exp(c(4))]
@state beta2 = beta2(-1) + [var = exp(c(5))]
@state beta3 = beta3(-1) + [var = exp(c(6))]


That is, each of the parameters beta follows a random walk.

It doesn't seem trivial in this case to do preestimation by OLS. Do you have any suggestions how that would work in this case?

Lastly: can you tell me whether it is possible to do any kind of model selection in state space models such as these (that is: to determine which regressors to include in the observation equation)?

Thanks again!
Last edited by student07 on Wed Mar 18, 2015 6:12 am, edited 1 time in total.

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

Re: State space model convergence

Postby trubador » Sun Mar 15, 2015 7:25 am

There is no feasible/easy way to provide reasonable estimates for c(3), c(4) and c(5) through OLS. You can do it only for c(1) and c(2), which will be stored in the coefficient vector c in the workfile.

Time varying parameter state space models are very flexible and therefore require more effort than that of their time-invariant counterparts and of other traditional regression models. Do you have any sound evidence that the parameters are actually time varying? Have you checked, for instance, the stability of coefficents? (e.g. Recursive Coefficent estimates in OLS) You can also try other types of parameter variations like random coefficient or AR(1) specifications.

As for model specification, there is nothing you can do other than trial-and-error. You can, of course, rely on the theory for a plausible set of explanatory variables. But which one is significant from the statistical point of view is a matter of empirical research. And there are plenty of diagnostic measures for that purpose.

student07
Posts: 18
Joined: Tue Jun 03, 2014 5:58 am

Re: State space model convergence

Postby student07 » Wed Mar 18, 2015 6:15 am

Thank you and I apologize for the late reply. Recursive least squares shows evidence for time-varying coefficients, so that is why I am considering this model.

I have decided for now to focus on the same model but then with just one regressor, i.e.

Code: Select all

@signal y = beta0 + beta1*x1 + [var = exp(c(2))]
@state beta0 = beta0(-1) + [var = exp(c(3))]
@state beta1 = beta1(-1) + [var = exp(c(4))]
.

I do get standard errors now for all coefficients, but they are all extremely large (in the order of *10^(20)). Do you know why this could be so and if this is wrong whether this can be fixed?

Also, can you tell me what exactly are the RMSE values in the series that I get through the makesignal command? As in, why is it a vector and not just (one) scalar? What would be the difference with using makesignal with t = resid, and then using @sqrt(@sumsq(resids)/(#observations - k - 1)) [where k the number of variables] (because that would result in just one number, and not a vector)? Which of the elements of the vector do I need?

Thanks again, I appreciate it.
trubador wrote:There is no feasible/easy way to provide reasonable estimates for c(3), c(4) and c(5) through OLS. You can do it only for c(1) and c(2), which will be stored in the coefficient vector c in the workfile.

Time varying parameter state space models are very flexible and therefore require more effort than that of their time-invariant counterparts and of other traditional regression models. Do you have any sound evidence that the parameters are actually time varying? Have you checked, for instance, the stability of coefficents? (e.g. Recursive Coefficent estimates in OLS) You can also try other types of parameter variations like random coefficient or AR(1) specifications.

As for model specification, there is nothing you can do other than trial-and-error. You can, of course, rely on the theory for a plausible set of explanatory variables. But which one is significant from the statistical point of view is a matter of empirical research. And there are plenty of diagnostic measures for that purpose.

BenNanke
Posts: 1
Joined: Wed Jul 24, 2019 7:38 am

Re: State space model convergence and singular covariance matrix

Postby BenNanke » Sun Aug 04, 2019 5:30 am

Hi everyone,
I am a buddying Eviews user dealing with local level State Space model for the first time. As the author of the original post here I struggle to handle thw Warning of Singular Covariance Matrix

I have daily consumer expenses data for a period of 2 years. I decided to try the model and used this article by BoE as a guide (starting from page 14):
https://cmi.comesa.int/wp-content/uploa ... ercise.pdf

I struggled to run the model using authors' data the whole day yesterday.
But now I want to make a forecast of my daily frequency data using this model

Hardly had I run the estimation of tha usual SSpace specification I got a WARNING of Singular Covariance matrix. This is SSpace specification:
@ename e1
@ename e2
@evar var(e1)=exp(C(1))
@evar var(e2)=exp(C(2))
@signal expenses=SV1+e1
@state SV1=SV1(-1)+e2


Could you kindly tell me how I could deal with the problem? I have read trubador's answers as well as those he provide in response to the post. More specifically these:
viewtopic.php?f=4&t=971
viewtopic.php?f=4&t=4366

I still do not get what exactly I am supposed to do. Set initial parameters? Is it to change them via command @mprior and @vprior?
Why in this article on SSpace local level model describing annual flow volume from the NIle the estimation runs smoothly?
https://www.jstatsoft.org/article/view/ ... 0He3JYyid8

On a general not I would extremely appreciate it if you commented on the genaral use of SSpace. Say I want to forecast high frequency dependent variable. I have no other regressors but a lagged dependent variable and a few dummy variables. After I get an estimation of sv1f, can I estimate an equation as follows: expenses = c + sv1f+ dummy_newyear+dummy_summerholid+cos+sin. I know the question is very extensive but a couple of clues would be of great help


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 46 guests