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
multivariate kalman filter
Moderators: EViews Gareth, EViews Moderator
multivariate kalman filter
- Attachments
-
- tfp_eviews.WF1
- (101.54 KiB) Downloaded 455 times
Re: multivariate kalman filter
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...
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...
Re: multivariate kalman filter
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?
@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?
Re: multivariate kalman filter
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...
Re: multivariate kalman filter
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
@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
Who is online
Users browsing this forum: No registered users and 2 guests
