I'm using this post and not create a new one. I already sove the problem if the covariance Matrix. I changed the Initial Values and I was able to get convergence. The problem is now, I get the following message: "error to improve log-likelodd". How can I solve this? I already tighted the parameters to 1e-6 and still get the error.
Please, I hope this time I get someone that can help.
Hello, I'm trying to estimate a state space model (trying to replicate the Diebold, Rudebusch & Aruoba (2006)) :
y_t = factors_t*lambda + error-> signal equation
factors_t = X*factors_(t-1) + error -> state equation (VAR(1))
I get the following error: "WARNING: Singular covariance - coefficients are not unique"
I do Belief I get the error because the last 3 latent factors on the vector of factors are mutiplied by zero in the signal equation, i.e., they only are inserted in the state equation in the Vector Autoregressive of lag 1.
I get the vec0 and var0 by estimate first the 3 latent factors without the last 3 (the last three are observable, but I insert as latent in the equation) and then do a VAR(1) to get the covariance matrix and use the mean of the 6 variables for the vec0.
I do post where the workingfile if someone can give it a look and help me. It would be extremely appreciated.Code: Select all
@signal y_3 =sv1+( ( 1-exp(-c(72)*3) ) / (c(72)*3) )*sv2+( ( ( 1-exp(-c(72)*3) ) / (c(72)*3) ) - ( exp(-c(72)*3) ) )*sv3 + (0)*sv4 + (0)*sv5 + (0)*sv6+[ename=e_3]
@signal y_12 =sv1+( ( 1-exp(-c(72)*12) ) / (c(72)*12) )*sv2+( ( ( 1-exp(-c(72)*12) ) / (c(72)*12) ) - ( exp(-c(72)*12) ) )*sv3 + (0)*sv4 + (0)*sv5 + (0)*sv6+[ename=e_12]
@signal y_24 =sv1+( ( 1-exp(-c(72)*24) ) / (c(72)*24) )*sv2+( ( ( 1-exp(-c(72)*24) ) / (c(72)*24) ) - ( exp(-c(72)*24) ) )*sv3 + (0)*sv4 + (0)*sv5 + (0)*sv6+[ename=e_24]
@signal y_36 =sv1+( ( 1-exp(-c(72)*36) ) / (c(72)*36) )*sv2+( ( ( 1-exp(-c(72)*36) ) / (c(72)*36) ) - ( exp(-c(72)*36) ) )*sv3 + (0)*sv4 + (0)*sv5 + (0)*sv6+[ename=e_36]
@signal y_60 =sv1+( ( 1-exp(-c(72)*60) ) / (c(72)*60) )*sv2+( ( ( 1-exp(-c(72)*60) ) / (c(72)*60) ) - ( exp(-c(72)*60) ) )*sv3 + (0)*sv4 + (0)*sv5 + (0)*sv6+[ename=e_60]
@signal y_84 =sv1+( ( 1-exp(-c(72)*84) ) / (c(72)*84) )*sv2+( ( ( 1-exp(-c(72)*84) ) / (c(72)*84) ) - ( exp(-c(72)*84) ) )*sv3 + (0)*sv4 + (0)*sv5 + (0)*sv6+[ename=e_84]
@signal y_120=sv1+( ( 1-exp(-c(72)*120) ) / (c(72)*120) )*sv2+( ( ( 1-exp(-c(72)*120) ) / (c(72)*120) ) - ( exp(-c(72)*120) ) )*sv3 + (0)*sv4 + (0)*sv5 + (0)*sv6+[ename=e_120]
@signal y_360=sv1+( ( 1-exp(-c(72)*360) ) / (c(72)*360) )*sv2+( ( ( 1-exp(-c(72)*360) ) / (c(72)*360) ) - ( exp(-c(72)*360) ) )*sv3 + (0)*sv4 + (0)*sv5 + (0)*sv6+[ename=e_360]
@state sv1 = c(37) + c(1)*( sv1(-1) - c(37) ) + c(2)*( sv2(-1) - c(38) ) + c(3)*( sv3(-1) - c(39) ) + c(4)*(sv4(-1) - c(40)) + c(5)*(sv5(-1) - c(41)) + c(6)*(sv6(-1) - c(42)) + [ename=ni_l]
@state sv2 = c(38) + c(7)*( sv1(-1) - c(37) ) + c(8)*( sv2(-1) - c(38) ) + c(9)*( sv3(-1) - c(39) ) + c(10)*(sv4(-1) - c(40)) + c(11)*(sv5(-1) - c(41)) + c(12)*(sv6(-1) - c(42)) + [ename=ni_s]
@state sv3 = c(39) + c(13)*( sv1(-1) - c(37) ) + c(14)*( sv2(-1) - c(38) ) + c(15)*( sv3(-1) - c(39) ) + c(16)*(sv4(-1) - c(40)) + c(17)*(sv5(-1) - c(41)) + c(18)*(sv6(-1) - c(42)) + [ename=ni_c]
@state sv4 = c(40) + c(19)*( sv1(-1) - c(37) ) + c(20)*( sv2(-1) - c(38) ) + c(21)*( sv3(-1) - c(39) ) + c(22)*(sv4(-1) - c(40)) + c(23)*(sv5(-1) - c(41)) + c(24)*(sv6(-1) - c(42)) + [ename=ni_sv4]
@state sv5 = c(41) + c(25)*( sv1(-1) - c(37) ) + c(26)*( sv2(-1) - c(38) ) + c(27)*( sv3(-1) - c(39) ) + c(28)*(sv4(-1) - c(40)) + c(29)*(sv5(-1) - c(41)) + c(30)*(sv6(-1) - c(42)) + [ename=ni_sv5]
@state sv6 = c(42) + c(31)*( sv1(-1) - c(37) ) + c(32)*( sv2(-1) - c(38) ) + c(33)*( sv3(-1) - c(39) ) + c(34)*(sv4(-1) - c(40)) + c(35)*(sv5(-1) - c(41)) + c(36)*(sv6(-1) - c(42)) + [ename=ni_sv6]
@evar var(ni_l)=exp(c(43))
@evar var(ni_s)=exp(c(44))
@evar var(ni_c)=exp(c(45))
@evar var(ni_sv4)=exp(c(46))
@evar var(ni_sv5)=exp(c(47))
@evar var(ni_sv6)=exp(c(48))
@evar cov(ni_l,ni_s)=c(49)
@evar cov(ni_l,ni_c)=c(50)
@evar cov(ni_l,ni_sv4)=c(51)
@evar cov(ni_l,ni_sv5)=c(52)
@evar cov(ni_l,ni_sv6)=c(53)
@evar cov(ni_s,ni_c)=c(54)
@evar cov(ni_s,ni_sv4)=c(55)
@evar cov(ni_s,ni_sv5)=c(56)
@evar cov(ni_s,ni_sv6)=c(57)
@evar cov(ni_c,ni_sv4)=c(58)
@evar cov(ni_c,ni_sv5)=c(59)
@evar cov(ni_c,ni_sv6)=c(60)
@evar cov(ni_sv4,ni_sv5)=c(61)
@evar cov(ni_sv4,ni_sv6)=c(62)
@evar cov(ni_sv5,ni_sv6)=c(63)
@evar var(e_3)=exp(c(64))
@evar var(e_12)=exp(c(65))
@evar var(e_24)=exp(c(66))
@evar var(e_36)=exp(c(67))
@evar var(e_60)=exp(c(68))
@evar var(e_84)=exp(c(69))
@evar var(e_120)=exp(c(70))
@evar var(e_360)=exp(c(71))
@mprior svec0
@vprior svar0