Dear Eviews useres,
I am trying to get potential GDP per capita using kalman filter method.
I followed Clark(1987) model which has a random walk with drift in the stochastic trend component.
1950-2004 GDP per capita data from Penn World Table 6.2 was used.
The stat space representation in Eviews is as follows.
@signal lnrealgdp*100 = sv1 + sv3
@state sv1 = sv2(-1) + sv(-1) + [var=exp((c1))]
@state sv2 = sv2(-1) + [var=exp((c2))]
@state sv3 = c(3)*sv3(-1) + c(4)*sv4(-1) + [var=exp((c5))]
@state sv4 = sv3(-1)
lnrealgdp = log real GDP per capita during 1950-2004. To improve numerical stability, the log of real GDP is multiplied by 100. This is done so that the derivatives of the log-likelihood can be more closely scaled.
sv1 - stochastic trend component
sv2 = drift term in the stochastic trend component as a random walk
sv3 = stationary cyclical component. As you can see, it is a simple AR(2) model. c(3) and c(4) are the first and second AR term respectively.
After estimating, it says 'Warning note of singular covariance - coefficients are not unique.'
I searched possible solutions in this forum and I found that I should specify the initial values by OLS. Or I can use the first observed value.
I have read some references for this issue, they, however, were not well defined.
Using param command, I can set the starting values for the estimation. (i.e. param c(1) 1 c(2) 1 ...)
Is there any one who can explain how to get the initial values correctly? Any comments on my work will be welcomed.
estimating natural GDP using kalman filter
Moderators: EViews Gareth, EViews Moderator
-
pbcscholar
- Posts: 3
- Joined: Tue May 19, 2009 8:39 pm
estimating natural GDP using kalman filter
Last edited by pbcscholar on Wed May 20, 2009 1:02 am, edited 2 times in total.
Re: estimating natural GDP using kalman filter
In order to do OLS, you should first find proxies for your two unobserved variables. For instance, you can extract the trend (and the gap) from your dependent variable via HP-filter. Then you can carry out an OLS estimation for the unknown parameter values. These will already be saved in the coefficient vector (i.e. c) in your workfile. So you do not need to supply these values into your sspace object manually via param command. You can simply run your state space model after the OLS estimation. However, be careful that two sets of coefficients refer to same variables.
Before moving on you may want to look at Startz's suggestions on a similar issue: http://forums.eviews.com/viewtopic.php?f=4&t=834#p2808
Before moving on you may want to look at Startz's suggestions on a similar issue: http://forums.eviews.com/viewtopic.php?f=4&t=834#p2808
-
pbcscholar
- Posts: 3
- Joined: Tue May 19, 2009 8:39 pm
Re: estimating natural GDP using kalman filter
Thank you for your super prompt reply.
I have some more questions here.
1. In carrying out an OLS estimation for the unknown parameter values, how should I handle the drift term, sv2?
What I want is to get the growth rate of potential output. If we assume that sv2 denotes the rate of drift, it may be thought of as the rate of growth of potential output. I am wondering how I can get sv2 series? I only got first two c values in each OLS estimation for trend and cycle.
2.
I have some more questions here.
1. In carrying out an OLS estimation for the unknown parameter values, how should I handle the drift term, sv2?
What I want is to get the growth rate of potential output. If we assume that sv2 denotes the rate of drift, it may be thought of as the rate of growth of potential output. I am wondering how I can get sv2 series? I only got first two c values in each OLS estimation for trend and cycle.
2.
What does this mean? It means I should save each set of coefficient separately? I am sorry. it comes from the lack of knowledge.However, be careful that two sets of coefficients refer to same variables.
Re: estimating natural GDP using kalman filter
You cannot handle the drift term, since it is an unobserved and a time varying variable. In the trend specification you can handle disturbance terms, exp(c(1)) and exp(c(2)). Although you can specify prior mean and variance values (feasible) for state variables, I am afraid it may complicate things and may do more harm than good. This is mainly because you must have good estimates or strong prior information on these values. So, for the moment, let's keep the initial conditions as diffuse.
In your model, the drift term is not very well identifed. If you consider E(SV2) = SV1-SV1(-1), then the distinction between the first and the second state equations becomes unclear. They more or less tell the same story. If you are really interested in the growth rate of potential output, then it will be better to specify a steady-state value and/or an AR(1) process for it instead of a random walk specification. Dropping the disturbance term in the first state equation (i.e. exp(c(1))) can be another approach, which will smooth the level of the trend.
Please note that you are trying to extract four unobserved variables and estimate five unknown parameters with only one observed variable at hand. It is really difficult to control the dynamics of such a system from both technical and practical point of view. You may need additional information on the theoratical relationships among these variables and/or on the domain of some parameters.
Each time you estimate an equation, EViews overrides the coefficent vector in your workfile (i.e. c). You can always create your own coefficent vector to play on the safe side.
In your model, the drift term is not very well identifed. If you consider E(SV2) = SV1-SV1(-1), then the distinction between the first and the second state equations becomes unclear. They more or less tell the same story. If you are really interested in the growth rate of potential output, then it will be better to specify a steady-state value and/or an AR(1) process for it instead of a random walk specification. Dropping the disturbance term in the first state equation (i.e. exp(c(1))) can be another approach, which will smooth the level of the trend.
Please note that you are trying to extract four unobserved variables and estimate five unknown parameters with only one observed variable at hand. It is really difficult to control the dynamics of such a system from both technical and practical point of view. You may need additional information on the theoratical relationships among these variables and/or on the domain of some parameters.
Each time you estimate an equation, EViews overrides the coefficent vector in your workfile (i.e. c). You can always create your own coefficent vector to play on the safe side.
-
pbcscholar
- Posts: 3
- Joined: Tue May 19, 2009 8:39 pm
Re: estimating natural GDP using kalman filter
Thank you very much for your answer, Trubador. I am sorry for this late response. It took me a while to reply.
As you suggested, I tried to build a state space representative with a constant drift term in a trend equation.
Harvey(1985) and Clark(1987) suggest the following model.
Y(t) = T(t) + C(t)
T(t) = d + T(t-1) + e(t)
C(t) = b(1)C(t-1) + b(2)C(t-2) + u(t)
where,
Y(t): observed GDP
T(t): trend. it is assumed to follow random walk with drift, d
C(t): cycle. It is assumed to follow AR(2)
b(1) and b(2): coefficients of AR(1) and AR(2)
Thanks to Trubador, I could get the starting values easily by HP filter and OLS.
In this case, the drift term, d can be the growth rate of potential output and it seems to fit the US data quite well.
When we consider large shifts in potential output grow in some countries, however, this model doesn't fit other countries.
So, Clark(1989) and some others indicate that this assumption is restrictive in the case of other economies and therefore let the rate of growth vary over time as follows.
Y(t) = T(t) + C(t)
T(t) = d(t-1) + T(t-1) + e(t)
d(t) = d(t-1) + v(t)
C(t) = b(1)C(t-1) + b(2)C(t-2) + u(t)
In this model, the drift term follows random walk too.
In Eviews, the above commands were used to estimate. Please see the first post.
Are these Eviews commands correct? I just built this command set based on the literatures.
In order to avoid the sigular covariance problem in estimation, I have to set the starting values of C in the model.
By HP filter (or other de-trending methods), I could extract T(t) and C(t) which are sv1 and sv3 respectively in the state space representative. And then I got c(1), c(3), c(4) and c(5) by OLS.
But I have no idea with c(2). Again, my qestion is how I can set the starting value of c(2).
If it is impossible to get the value, how many others could conduct their research with the same model?
I asked this question to some paper authors but no one wrote me back yet. So I am late to post the next one.
How about doing Monte Carlo simulation with white noise to generate unobserved drift series, d(t)? Then, is the variance, C(2) from the artificially generated drift, d(t) valid to use for the starting value?
Does anyone have an idea?
As you suggested, I tried to build a state space representative with a constant drift term in a trend equation.
Harvey(1985) and Clark(1987) suggest the following model.
Y(t) = T(t) + C(t)
T(t) = d + T(t-1) + e(t)
C(t) = b(1)C(t-1) + b(2)C(t-2) + u(t)
where,
Y(t): observed GDP
T(t): trend. it is assumed to follow random walk with drift, d
C(t): cycle. It is assumed to follow AR(2)
b(1) and b(2): coefficients of AR(1) and AR(2)
Thanks to Trubador, I could get the starting values easily by HP filter and OLS.
In this case, the drift term, d can be the growth rate of potential output and it seems to fit the US data quite well.
When we consider large shifts in potential output grow in some countries, however, this model doesn't fit other countries.
So, Clark(1989) and some others indicate that this assumption is restrictive in the case of other economies and therefore let the rate of growth vary over time as follows.
Y(t) = T(t) + C(t)
T(t) = d(t-1) + T(t-1) + e(t)
d(t) = d(t-1) + v(t)
C(t) = b(1)C(t-1) + b(2)C(t-2) + u(t)
In this model, the drift term follows random walk too.
In Eviews, the above commands were used to estimate. Please see the first post.
Are these Eviews commands correct? I just built this command set based on the literatures.
In order to avoid the sigular covariance problem in estimation, I have to set the starting values of C in the model.
By HP filter (or other de-trending methods), I could extract T(t) and C(t) which are sv1 and sv3 respectively in the state space representative. And then I got c(1), c(3), c(4) and c(5) by OLS.
But I have no idea with c(2). Again, my qestion is how I can set the starting value of c(2).
If it is impossible to get the value, how many others could conduct their research with the same model?
I asked this question to some paper authors but no one wrote me back yet. So I am late to post the next one.
How about doing Monte Carlo simulation with white noise to generate unobserved drift series, d(t)? Then, is the variance, C(2) from the artificially generated drift, d(t) valid to use for the starting value?
Does anyone have an idea?
Who is online
Users browsing this forum: No registered users and 2 guests
