NAIRU and Kalman Filter

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

unforgiven02
Posts: 3
Joined: Tue May 12, 2009 7:57 am

NAIRU and Kalman Filter

Postby unforgiven02 » Thu May 14, 2009 5:43 am

I would like to use Kalman Filter for estimating the NAIRU. I'am using the model :

@signal ur = trend + gap

@state trend = trend(-1) + kappa(-1)+ [var = exp(c(1))]
@state kappa = kappa(-1) + [var = exp(c(2))]
@state gap = gap(-1) + [var = exp(c(3))]

ur:unemployment
kappa:drift term
trend: long term equilibrium unemployment
gap: deviations from equilibrium unemployment

But, I received the massege: WARNING: Singular covariance - coefficients are not unique and there are no std. errors, Z-statisics and prob. values.

Can someone recommend a solution for this problem?
thanx.

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

Re: NAIRU and Kalman Filter

Postby trubador » Thu May 14, 2009 6:16 am

The problem may be stemming from starting values and may be solved by assigning different initial values for c() coefficients. You'll find many discussions on this issue, if you search the forum. Since the gap is defined as a random walk, you can also specify your model in a more compact way:

Code: Select all

@signal ur = trend + [var = exp(c(3))] @state trend = trend(-1) + kappa(-1)+ [var = exp(c(1))] @state kappa = kappa(-1) + [var = exp(c(2))]
Other than the technical part of issue, the time series decomposition model you are about perform might be too flexible for your data. If you are not trying to replicate another study or obliged to specify the model in that way, you may wish to drop the variance specification in your first state equation.The long term trend is expected to be a smooth component especially for growth, unemployment, etc.

You may get more help, if you could post your workfile that includes the data.

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

Re: NAIRU and Kalman Filter

Postby startz » Thu May 14, 2009 6:27 am

A couple of points.

(1) Are you sure you want the gap to follow a random walk rather than an AR model?
(2) With that adjustment, this would be the Clark model. kappa isn't very well identified in that model.
(3) You may want to consider allowing correlation between the errors, as in the Morley, Nelson, and Zivot model.

sunny
Posts: 12
Joined: Wed Oct 23, 2013 2:03 am

Re: NAIRU and Kalman Filter

Postby sunny » Thu Apr 10, 2014 6:57 am

Trying to follow clark (1987) and decompose gdp into potential and cyclical side.
@signal log_y_sa=pot+cyc
@state pot=pot (-1) + g (-1)
@state g = g(-1) + [var=exp(c(2))]
@state cyc = c(3)*cyc (-1) + c(4)*sv1(-1)+ [var=exp(c(5))]
@state sv1=sv1(-1)

param c(3) .72 c(4) -0.03 c(5) 0.011

For initial values i have run ols over the cyclical gdp arrived by using hp filter...but i am not getting good result...I just have one variable but i am getting error "Singular covariance - coefficients are not unique" which points to multicolineriality in the model ...which i cannot understand..

Another catch is that I am not sure that i have given proper value (co-officients are in equation work file)...I have attached the complete workfile for your referecne..

Very greatful for your help....

Thanks,
Toshi


Sspace: UNIVARIATE
Method: Maximum likelihood (Marquardt)
Date: 04/10/14 Time: 19:21
Sample: 6/01/1996 12/01/2013
Included observations: 71
Convergence achieved after 15 iterations
WARNING: Singular covariance - coefficients are not unique

Coefficient Std. Error z-Statistic Prob.

C(2) -86.01288 NA NA NA
C(3) 1.000146 NA NA NA
C(4) -1.22E-05 NA NA NA
C(5) -9.214670 NA NA NA

Final State Root MSE z-Statistic Prob.

POT -96.30778 692.0439 -0.139164 0.8893
G -0.000739 0.101180 -0.007304 0.9942
CYC 112.5578 692.0444 0.162645 0.8708
SV1 -17.31571 999.5702 -0.017323 0.9862

Log likelihood 201.8596 Akaike info criterion -5.573509
Parameters 4 Schwarz criterion -5.446035
Diffuse priors 4 Hannan-Quinn criter. -5.522817
Attachments
base_data.wf1
(20.75 KiB) Downloaded 881 times

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

Re: NAIRU and Kalman Filter

Postby trubador » Thu Apr 10, 2014 2:27 pm

Please note that you have only one observable in the model. Therefore you impose certain dynamics on the unobservables to control their behavior and to reduce the flexibility of model. Diffuse priors may not work efficiently in these models, so you may need to initialize states (especially the variances) with appropriate values, which requires a bit of experimenting. As a starting point, you can work on the following model specification:

Code: Select all

sym(4) vprior vprior(1) = 5 @signal log_y_sa = pot + cyc @state pot = pot(-1) + g(-1) @state g = g(-1) + [var=exp(c(2))] @state cyc = c(3)*cyc(-1) + c(4)*sv1(-1)+ [var=exp(c(5))] @state sv1 = cyc(-1) @vprior vprior param c(1) .0 c(2) -9.0 c(3) .7 c(4) -0.03 c(5) -11.0

sunny
Posts: 12
Joined: Wed Oct 23, 2013 2:03 am

Re: NAIRU and Kalman Filter

Postby sunny » Thu Apr 10, 2014 11:14 pm

many thanks for your help ...Wil try to make sense what you done..

Best,
Toshi

sunny
Posts: 12
Joined: Wed Oct 23, 2013 2:03 am

Re: NAIRU and Kalman Filter

Postby sunny » Mon Apr 14, 2014 1:15 pm

Hi,
I initialized the value using the OLS equations.. I am not sure if i done it correctly ( as i am getting Singular covariance - coefficients are not unique on running the model
) .. I looked around and could not find a post on which value to initialize .. hence thought of writing the post...workfile attached ( i am using the varaibles & coefficient names as per workfile)..

For the state variables, the initial priors have set as follows

intial state value(using svec0) state variance(using svar0)
pot 15.13 (first observaton of series hptrend01) (0.35)^2= 0.1235 - variance of hptrend01
cyc -0.011 (second observation of series cyc_hp) (0.011)^2=0.00013 - variance of cyc_hp
sv1 0.00929 (first observation of series cyc_hp) (0.011)^2= 0.00013- variance of cyc_hp

I am assuming no co-variance between state equations.. is it right ? .. especially between (2) and (3) - state eqn..there should be definately strong covaraince ?

for the parameters (initialized using param) from equation 1 & 2 of the workfile...i have initialised as per

c(1) = -0.21 (equation 2 )
c(2) = log (0.000409)= -3.38 or log (variance of residual of equation 2) - not sure abt this ?
c(3) = 0.71 (equation 1)
c(4) = -0.03 (equation 1)
c(5) - log (0.0084)= 0.7119 or log (variance of residuals of equation 1)

have I initalized the proper value or there are massive problems in my understanding...
I want to make sure i am initalising the right values and getting right results as i have move to multivariate filter from univariate filter of GDP

As always thanks a million...appreicate all your help!!!!
Attachments
base_data.wf1
(22.72 KiB) Downloaded 863 times

sunny
Posts: 12
Joined: Wed Oct 23, 2013 2:03 am

Re: NAIRU and Kalman Filter

Postby sunny » Mon Apr 14, 2014 1:17 pm

Sorry i understand i can initalise using other value choosing randomily , as you did earlier.. but i wanted to understand what should be ideal initalization process using ols .. hence have gone at length in my earlier post... thanks for your help...

sunny
Posts: 12
Joined: Wed Oct 23, 2013 2:03 am

Re: NAIRU and Kalman Filter

Postby sunny » Wed Apr 16, 2014 10:55 am

Guys I know that u reserve right to response and rightly so....but will greatly appreciate a reply here...seems to be stuck... initial values are impacting the results ..so Its crucial i have proper values....

Please see if you can accommodate...

Thanks a million,
Sunny

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

Re: NAIRU and Kalman Filter

Postby trubador » Wed Apr 16, 2014 3:00 pm

As I mentioned in my previous post, the main problem with these models is the initialization of the variance of states (not the coefficients). Although OLS or HP estimations might help, there is no guarantee for robust results. You should experiment with different values and see if you can obtain a higher likelihood. In your example, for instance, the convergence is achieved but the final hessian is not invertable due to c(5) = -310, which practically corresponds to zero variance. You can try AR(1) specification for cycles. And note that you have defined the potential output variable as random walk with drift, which is very flexible and captures most of the dynamics. Therefore you should also be careful for ill-defined models...

sunny
Posts: 12
Joined: Wed Oct 23, 2013 2:03 am

Re: NAIRU and Kalman Filter

Postby sunny » Wed Apr 16, 2014 10:53 pm

Thanks a lot... Will try to tighten up the model ...try various state varaince values ...Add inflation, capacity utilisation and monetary conditions index to get a true multivariate potential growth model...And get back for your final comments .. Thks a lot..this blog is a big help!!!!

eca05jpm
Posts: 9
Joined: Wed Apr 16, 2014 2:58 am

Re: NAIRU and Kalman Filter

Postby eca05jpm » Thu Apr 17, 2014 7:58 am

Hi Sunny, I'm trying to do something similar on UK data so if you have any success I would be very grateful if you could post your workfile so I can see what worked for you.

Many thanks and best of luck,

Jamie

sunny
Posts: 12
Joined: Wed Oct 23, 2013 2:03 am

Re: NAIRU and Kalman Filter

Postby sunny » Sat Apr 19, 2014 4:43 am

Sure Jamie .. Will definately do..

sunny
Posts: 12
Joined: Wed Oct 23, 2013 2:03 am

Re: NAIRU and Kalman Filter

Postby sunny » Tue Apr 22, 2014 4:25 am

Hi trubador,

Please see below the results and the program file. I have used program that uses 1000 random values to initalize variance of the state and signal equations. Trying to find the best solution i get the final result mentioned below.

The issue is the result is way different from what i would expect .

I tried the run the prog. using MA(2) error in enf signal equation but as I was non-significant coefficient i did not include them.

Hence what i have given a final model ....I will great to get a feedback if i am doing something fundementally stupid or wrong ?

Sspace: SOLUTION
Method: Maximum likelihood (Marquardt)
Date: 04/22/14 Time: 16:45
Sample: 6/01/1996 12/01/2013
Included observations: 71
Convergence achieved after 30 iterations

Coefficient Std. Error z-Statistic Prob.

C(1) -0.002167 0.003302 -0.656311 0.5116
C(2) 0.303640 0.146091 2.078430 0.0377
C(3) 0.002799 0.009892 0.282984 0.7772
C(4) 0.008641 0.003446 2.507330 0.0122
C(5) 2.023437 0.115768 17.47845 0.0000
C(6) 0.000255 0.000278 0.915261 0.3601
C(7) 0.016848 0.001416 11.89708 0.0000
C(8) -0.000426 0.000241 -1.764388 0.0777
C(9) 0.710780 0.180208 3.944220 0.0001
C(10) -18.32714 7.015250 -2.612472 0.0090

Final State Root MSE z-Statistic Prob.

CYC 0.052066 0.003947 13.19242 0.0000
POT 16.20053 0.009693 1671.413 0.0000
SV1 11.49422 2.046851 5.615564 0.0000
SV2 11.49422 0.308706 37.23351 0.0000

Log likelihood 47.32539 Akaike info criterion NA
Parameters 10 Schwarz criterion NA
Diffuse priors 4 Hannan-Quinn criter. NA




Thanks as always!!
Toshi
Attachments
bi_data.wf1
eviews.workfile
(61.53 KiB) Downloaded 992 times
prog1.prg
prog
(1.45 KiB) Downloaded 1382 times

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

Re: NAIRU and Kalman Filter

Postby trubador » Tue Apr 22, 2014 5:18 am

Yes, random initialization of coefficients "might" help ease the problem. Please keep in mind that I have been warning you against the initialization of states. Anyway, I still think your model is ill-defined. I am guessing enf and mci correspond to inflation and monetary conditions index, respectively. If so, then the relationships among these variables are not defined clearly and properly. Before taking that venue and complicating your model, start with a more parsimonious and theoretically valid model. You can then improve upon it if need be...


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests