trouble setting up state space to use in MARSS

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

trouble setting up state space to use in MARSS

Ed_R
I am estimating an unobserved components Phillips curve model.  There are two state variables X1 which is a random walk (the unobserved natural rate of unemployment and X2 which is the lag of X1.  X2 appears in my first observation equation and X1 appears in my second observation equation.  My B matrix therefore has a column of zeros -- is that the problem?

B
1 0
1 0




> #read data for Phillips Curve UC model
> gdp<-read.csv("phillipsdata.csv")
> lastrow<-nrow(gdp)
> data_mat<-data.matrix(gdp)
> run_dat<-t(data_mat[5:223,c(3,6)])
> pi1<-t(data_mat[4:222,c(3)])
> pi2<-t(data_mat[3:221,c(3)])
> pi3<-t(data_mat[2:220,c(3)])
> pi4<-t(data_mat[1:219,c(3)])
> u1<-t(data_mat[4:222,c(3)])
> gap0<-t(data_mat[5:223,c(1)])
> gap1<-t(data_mat[4:222,c(1)])
> gap2<-t(data_mat[3:221,c(1)])
> gap3<-t(data_mat[2:220,c(1)])
>
> combo<-rbind(pi1,pi2,pi3,pi4,u1,gap0,gap1,gap2,gap3)
>
>
> B1=matrix(list(1,1,0,0),2,2)
> Q1=matrix(list("q11",0,0,0),2,2)
> Z1=matrix(c(0,1,-1,0),2,2)
> A1="zero"
> D1=matrix(c("d11",0,"d12",0,"d13",0,"1-d11-d12-d13",0,1,0,0,"d25",0,"d26",0,"d27",0,"d28"),2,9)
> #A1=matrix(list(0,0),2,1)
> R1=matrix(list(1,0,0,1),2,2)
> pil=matrix(0,2,1)
> model.list=list(B=B1,Q=Q1,Z=Z1,A=A1,R=R1,D=D1,d=combo,x0=pil)
> fit=MARSS(run_dat, model=model.list)
Stopped at iter=1 in MARSSkem at U update. denom is not invertible.
 par, kf, states, iter, loglike are the last values before the error.
 Try control$safe=TRUE which uses a slower but slightly more robust algorithm.
 Use control$trace=1 to generate a more detailed error report. See user guide for insight.
>