Page 1 of 1
state space model for time varying parameters
Posted: Tue Mar 24, 2015 11:28 pm
by kaner
I am trying to estimate time varying parameters by the following equation form:
signal equation
yt = xtβt + ztAt + et et ∼ N(0, R)
state equation
βt = βt−1 + vt vt ∼ N(0, Q)
At = At−1 + wt wt ∼ N(0, H)
my questions are
1) First, I would like to allow all parameters to vary over time (says B and A). After that, if the result turn out that any parameter (say A) is not significantly vary over time, I will adjust the model to allow time varying only on another parameters (say B). How and where can I see from the result given by Eviews that the time-varying is significant?
2) Since I would like to find the time-varying series of the coefficients, could you suggest me how to get the series? To be more specific, in this case, if both A and B are significantly vary over time, how to get the series of A and B?
Actually, I have read the manual for Eviews6 which is the version I used, I think that I may get the series from proc/make state series/filters:state estimate OR smoothed:state estimates. Is it the correct way to get the series?
Thank you very much in advance for your answer.
Re: state space model for time varying parameters
Posted: Wed Mar 25, 2015 1:10 am
by trubador
It depends on the context, but smoothed estimates would be fine in your context. If you also save "state estimate SEs", you can use them to build confidence intervals. View/State views/Graph State Series will also be helpful for visual inspection.
Re: state space model for time varying parameters
Posted: Wed Mar 25, 2015 9:23 pm
by kaner
thank you very much for your answer, Trubador.
However, do you have any suggestion for my first question?
I tried to run the model and the state series are not so different across time so now I'm not quite sure whether I should use time varying for these parameters.
Re: state space model for time varying parameters
Posted: Thu Mar 26, 2015 2:34 am
by trubador
If it is not time varying, then it is better to fix it.
Re: state space model for time varying parameters
Posted: Fri Mar 27, 2015 12:24 am
by kaner
Thanks Trubador.
Let me ask more questions.

- Clip.jpg (94.11 KiB) Viewed 13016 times
To be more specific, here is the result I got from the following model.
@signal X = sv1*A + sv2*B + sv3*C + sv4*D + [var = exp(c(1))]
@state sv1 = sv1(-1)
@state sv2 = sv2(-1)
@state sv3 = sv3(-1)
@state sv4 = sv4(-1)
Do you have any suggestion since the results look not correct in my opinion.
And will adding the variance in state equations change the results?
when I try to add variance for the state equations as
@state sv1 = sv1(-1) + [var = exp(c(2))]
@state sv2 = sv2(-1) + [var = exp(c(3))]
@state sv3 = sv3(-1) + [var = exp(c(4))]
@state sv4 = sv4(-1) + [var = exp(c(5))]
it report the error that "WARNING: Singular covariance - coefficients are not unique."
again, this is Eviews6 version.
Re: state space model for time varying parameters
Posted: Fri Mar 27, 2015 12:46 am
by kaner
and one more question:
what is the reason for this message in the estimation output of sspace and how to solve it?
"Failure to improve Likelihood after 1 iteration"
Thank you very much in advance for your help.
Re: state space model for time varying parameters
Posted: Fri Mar 27, 2015 2:19 am
by trubador
To be more specific, here is the result I got from the following model.@signal X = sv1*A + sv2*B + sv3*C + sv4*D + [var = exp(c(1))]@state sv1 = sv1(-1)@state sv2 = sv2(-1)@state sv3 = sv3(-1)@state sv4 = sv4(-1)Do you have any suggestion since the results look not correct in my opinion.
There is nothing wrong with the model. It is simply a fixed parameter model and is no different than its OLS counterpart:
Code: Select all
wfcreate u 200
series x = nrnd
series y = 3*x + nrnd
equation eq.ls y x
scalar var = 2*log(eq.@se)
line eq.@coef(1) eq.@coef(1)+2*eq.@stderrs(1) eq.@coef(1)-2*eq.@stderrs(1)
sspace ss
ss.append @signal y = sv1*x + [var = exp(c(1))]
ss.append @state sv1 = sv1(-1)
ss.append param c(1) .0 c(2) .0
ss.ml
ss.stategraphs(t=smooth)
And will adding the variance in state equations change the results? when I try to add variance for the state equations as@state sv1 = sv1(-1) + [var = exp(c(2))]@state sv2 = sv2(-1) + [var = exp(c(3))]@state sv3 = sv3(-1) + [var = exp(c(4))]@state sv4 = sv4(-1) + [var = exp(c(5))]
Of course it will change the results, as you are now estimating a completely different model. In this one, you allow parameters change over time. If they are in fact time invariant, then the estimation results will produce very high negative values for coefficients c(2), c(3), c(4) and c(5) forcing the variance to zero. And it may also lead to convergence problems.
what is the reason for this message in the estimation output of sspace and how to solve it?"Failure to improve Likelihood after 1 iteration"
There are plenty of models and discussions in the forum regarding the state space estimation. Please do a search for more details.
Re: state space model for time varying parameters
Posted: Sat Mar 28, 2015 4:56 am
by kaner
Thank you so much, Trubador. It is more clear to me now.
However, I still get the warning of singular covariance. I tried to search for the solution in this forum and found that adding
initial values might solve this problem.
But even I add initial value for state variance, it still cannot be solved.
Could you please check my workfile so that you can suggest me what is the major mistake I have to adjust?
Thank you very much in advance for your suggestion.
Re: state space model for time varying parameters
Posted: Sat Mar 28, 2015 11:56 am
by trubador
State space models are not like their OLS counterparts. They are very flexible and therefore require well defined models. You cannot expect them to work smoothly and produce a feasible output each time you run the model. They do not operate like OLS models. As for your model:
1) There are 10 parameters that need to be estimated, but you have only 60 observations. Usually, small samples are problematic for such flexible and complicated models.
2) You have no evidence that supports the time variation in the parameters to begin with.
3) OLS estimates indicate that some of the coefficients are not even significant.
4) State space estimates indicate that half of the variance estimates are practically zero, which also lead to "singular covariance" problem.
There have been plenty of discussions in the forum regarding these very same problems. Your case is not really not an exception. This is an ill-defined model and needs to be revised. For instance, you can begin with a model that has only one time-varying parameter and then increase that number at each step. You can also try different specifications other than random walk.
If you need further help, you can refer to a textbook.
Re: state space model for time varying parameters
Posted: Sun Mar 29, 2015 5:28 am
by kaner
Thank you very much, trubador.
I tried according to your suggestion by
1) excluding the insignificant variables (from OLS result)
2) using only one or two time-varying parameters
and get the following code:
Code: Select all
@signal dlpm = sv1*dlneer + sv2*dlneer(1) + c(2)*dlbrent + c(3)*ygap(1) + [ename=e1, var = exp(c(4))]
@state sv1 = sv1(1) + [ename=e2, var = exp(c(5))]
@state sv2 = sv2(1) + [ename=e3, var = exp(c(6))]
@vprior svar02
The warning of singular covariance problem did disappear!!
However, I have more questions regarding the result. I got the state series as attached, but the variance of error term of state equation is quite low (c(5) = -5.32577).

- Clip_2.jpg (23.21 KiB) Viewed 12876 times
Therefore, could you please clarify more about your previous suggestion
"2) You have no evidence that supports the time variation in the parameters to begin with."
I wonder that is the variance is too low or not? and is there any other criteria to determine that the parameter is time-varying?
Thank you very much in advance for your help.
Re: state space model for time varying parameters
Posted: Sun Mar 29, 2015 8:16 am
by trubador
But even I add initial value for state variance, it still cannot be solved.
Initializing the state variance matrix is a tricky business. It should be the last thing to do. Try other remedies and see if any one works.
I got the state series as attached, but the variance of error term of state equation is quite low (c(5) = -5.32577).
Actually, the estimated variance is exp(c(5)). Of course it would depend on the scale of the variable, but for high negative values, say 20, it is practically zero indicating no variance for that coefficient.
is there any other criteria to determine that the parameter is time-varying?
You already did an OLS estimation. You can check for recursive coefficient estimates.
Look carefully at the chart. Although it appears to be time varying, the confidence interval is too wide making the estimates insignificant at all.
Re: state space model for time varying parameters
Posted: Wed Apr 01, 2015 1:32 am
by kaner
Thank you very much trubador :)
Re: state space model for time varying parameters
Posted: Wed Apr 08, 2015 4:31 am
by kaner
Hello, trubador
I would like to clarify one more thing.
Is my understanding correct that the smoothed series from state space model in eviews come from utilization of Kalman filter?
what is the proc/make kalman filter for?