Local linear trend estimation
Posted: Wed Nov 11, 2015 11:49 am
I’m trying to familiarise myself with estimating Unobserved Component models with Dynare. As an exercise I am trying to simulate and estimate simple models that would normally be used for output gap estimation. Below are 2 sample model blocks for models V1 and V2 respectively. V2 is a standard local linear trend (eg see Harvey and Jaeger 1993)
// 1. Model equations V1
Y = T + eps_1;
T = T(-1) + eps_2;
end;
// 1. Model equations V2
Y = T + eps_1;
T = T(-1) + 1*d(-1) + eps_2;
d = d(-1) + eps_3;
end;
The simulation all works fine. For estimation however, when I go from model V1 to model V2, the parameters (eps_1, eps_2 and eps_3) are successfully estimated, but I get the below error (note that this occurs on the last line of dynare.m).
Any thoughts what could be causing the problem after such a simple change to the model? Note also that if I change the coeffient on d(-1) in the T equation to 0.5 the error is no longer displayed.
Many thanks,
Dynaresaur
----------------------------
“Error using +
Matrix dimensions must agree.
Error in missing_DiffuseKalmanSmootherH1_Z (line 128)
a(:,:,t+1) = T*(a(:,:,t)+Kstar(:,:,t)*v(:,t));
Error in DsgeSmoother (line 164)
[alphahat,epsilonhat,etahat,ahat,P,aK,PK,decomp] = missing_DiffuseKalmanSmootherH1_Z(ST, ...
Error in dynare_estimation_1 (line 920)
[atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,T,R,P,PK,decomp] =
DsgeSmoother(xparam1,dataset_.info.ntobs,dataset_.data,dataset_.missing.aindex,dataset_.missing.state);
Error in dynare_estimation (line 70)
dynare_estimation_1(var_list,dname);
Error in UC_HP_filter_replic_v15a (line 116)
dynare_estimation(var_list_);
Error in dynare (line 120)
evalin('base',fname) ;”
// 1. Model equations V1
Y = T + eps_1;
T = T(-1) + eps_2;
end;
// 1. Model equations V2
Y = T + eps_1;
T = T(-1) + 1*d(-1) + eps_2;
d = d(-1) + eps_3;
end;
The simulation all works fine. For estimation however, when I go from model V1 to model V2, the parameters (eps_1, eps_2 and eps_3) are successfully estimated, but I get the below error (note that this occurs on the last line of dynare.m).
Any thoughts what could be causing the problem after such a simple change to the model? Note also that if I change the coeffient on d(-1) in the T equation to 0.5 the error is no longer displayed.
Many thanks,
Dynaresaur
----------------------------
“Error using +
Matrix dimensions must agree.
Error in missing_DiffuseKalmanSmootherH1_Z (line 128)
a(:,:,t+1) = T*(a(:,:,t)+Kstar(:,:,t)*v(:,t));
Error in DsgeSmoother (line 164)
[alphahat,epsilonhat,etahat,ahat,P,aK,PK,decomp] = missing_DiffuseKalmanSmootherH1_Z(ST, ...
Error in dynare_estimation_1 (line 920)
[atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,T,R,P,PK,decomp] =
DsgeSmoother(xparam1,dataset_.info.ntobs,dataset_.data,dataset_.missing.aindex,dataset_.missing.state);
Error in dynare_estimation (line 70)
dynare_estimation_1(var_list,dname);
Error in UC_HP_filter_replic_v15a (line 116)
dynare_estimation(var_list_);
Error in dynare (line 120)
evalin('base',fname) ;”