multivariate 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

laylian
Posts: 3
Joined: Wed Mar 27, 2013 8:11 pm

multivariate kalman filter

Postby laylian » Wed Mar 27, 2013 8:25 pm

Hi members of the forum,

I really need help to figure out why my multivariate kalman filter won't run properly. I'm trying to estimate the output gap by specifying the phillips curve, the nairu and the unemployment gap all in a system of equations. When I run the first part which is just the output gap, the singular matrix message appears and when I tried for all the equations, the syntax error appears for the phillips equation.


@signal gdp = trend + ygap + [var = exp(c(1))]
@state trend = trend(-1)+dtrend(-1)+ [var = exp(c(2))]
@state dtrend = dtrend(-1) + [var=exp(c(3))]
@state ygap = c(5)*ygap(-1) + c(6)*ygap2(-1) + [var = exp(c(4))]
@state ygap2 = ygap(-1)

@signal dinf=c(7)*dinf(-1)+c(8)*ungap+c(9)*dtfp_cyc+c(10)*dpoil+[var=exp(c(11))]
@signal un=un_hp+ungap
@state ungap=c(12)*ungap(-1)+ c(13)*ygap+[var=exp(c(14))]
@state un_hp=un_hp(-1)+[var=exp(c(15))]
@state dftp_cyc=[var=exp(c(16))]
@state dpoil = c(17)*dpoil(-1)+[var=exp(c(18))]


Desperately need help. Thanks
Attachments
tfp_eviews.WF1
(101.54 KiB) Downloaded 455 times

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

Re: multivariate kalman filter

Postby trubador » Thu Mar 28, 2013 5:28 am

Please search the forum for more details, since similar issues have been discussed before. Having said that, I should mention a few more things specific to your case:
1) I suspect "doilp" refers to change in oil prices. If so, then it should not be defined as a state variable. If not, then it means dpoil is an unobserved variable with AR(1) dynamics and c(10) is redundant.
2) I suspect "dtfp_cyc" refers to change in the cyclical component of total factor productivity. If so, then you should explicitly define the dynamics of TFP as you did for other variables. If not, then you seem to have defined it as a pure noise variable and there is no way the model can identify and distinguish its impact from the error term, [var=exp(c(11))].
As I see it, there is too much work to be done to make this model run smoothly...

laylian
Posts: 3
Joined: Wed Mar 27, 2013 8:11 pm

Re: multivariate kalman filter

Postby laylian » Fri Mar 29, 2013 2:01 am

thanks for your comments. Just ran the model:

@signal gdp = trend + ygap
@state trend = trend(-1) + dtrend(-1) + ygap(-1)+[var = exp(c(1))]
@state dtrend = dtrend(-1)+ [var = exp(c(2))]
@state ygap= c(4)*ygap2(-1) + [var=exp(c(3))]
@state ygap2=ygap(-1)



@signal dinf=c(6)*ungap+c(7)*dtfp_cyc(-1)+c(8)*dinf(-1)+[var=exp(c(11))]
@signal dtfp_cyc=trend+[var=exp(c(12))]

@state ungap=c(9)*ygap(-1)+ungap(-1)

Although everything looks OK, I get very big z-statistics numbers, is that OK?

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

Re: multivariate kalman filter

Postby trubador » Fri Mar 29, 2013 5:57 am

Yes, that is a very big problem. Try re-initializing the coefficent vector (c). I do not think it is going to be much of a help, because the model is still too flexible with too many unobserved variables...

laylian
Posts: 3
Joined: Wed Mar 27, 2013 8:11 pm

Re: multivariate kalman filter

Postby laylian » Thu Apr 11, 2013 1:02 am

Could you tell me give me some idea as to how to fix the problem, as I'm actually trying to replicate the work on the slovakian eocnomy. It system has 8 equations, philips curve and nairu.

@signal lgdp = trend + ygap
@state trend = trend(-1) + dtrend(-1) + ygap(-1)
@state dtrend = dtrend(-1)
@state ygap= c(4)*ygap2(-1) + e1
@state ygap2=ygap(-1)

@signal dinf = c(5)*dinf(-1) + c(6)*ugap + c(7)*dppi_m + c(8)*dpoil+ c(9)*tfp_cyc(-1)+ e2

@signal u = ugap + u_tr
@state u_tr = u_tr(-1) + [var = 0.4]
@state ugap = ugap(-1)+ygap(-1)+[var = 0.01]

param c(1) .0 c(2) .0 c(3) .0 c(4) .217688 c(5) -0.245702 c(6) 0.010339 c(7) .386139 c(8) .019925 c(9) 10.000
@ename e1
@ename e2

@evar cov(e1, e2) = 0
@evar var(e1) = .0001
@evar var(e2) = .0001
@mprior initial


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests