Local linear trend estimation

UPDATE


I tried to resolve the above AR(2) instability issue using the nice approach laid out in this post: Estimation AR(2)-process/Joint prior distribution

This seems to work if I only estimate the AR coefficients. However, when I attempt to estimate the variances in addition then estimates of the AR coefficents (calculated indirectly from the roots) are no longer close to the values used in the simulation.

Code is copied below. Any insight would be much appreciated.


var C Y T Dd;
varexo eps_1 eps_2 eps_3;

parameters root1 root2;

//rho1=1.5;
//rho2=-0.6;
root1=0.95; //root1=1.5/2+sqrt((1.5/2)^2+(-0.6))
root2=0.55; //root1=1.5/2-sqrt((1.5/2)^2+(-0.6))

model;
// parameter conversion

rho1= (root1+root2);

rho2= - root1*root2;

// model equation
Y = T + C;
C = rho1C(-1)+rho2C(-2)+ eps_1;
(T-T(-1))-(T(-1)-T(-2))= Dd(-1) + eps_2-eps_2(-1);
Dd = eps_3;
end;

// 2. Steady-state
steady_state_model;
T = 1;
Y = 1;
Dd=0;
C = 0;
end;

shocks;
var eps_1; stderr 0.1;
var eps_2; stderr 0.1;
var eps_3; stderr 0.1;
end;

stoch_simul(periods=2501, order=1);
save d_obs Y;

//3.2 ML Estimation

estimated_params;
stderr eps_1, 0.01, 0, 1;
stderr eps_2, 0.01, 0, 1;
//stderr eps_3, 0.01, 0, 1;
root1, 0.95, -0.9999, 0.9999;
root2, 0.55, -0.9999, 0.9999;
end;

varobs Y;

estimation(datafile=d_obs, presample=4, first_obs=1, mode_compute=4, mode_check, diffuse_filter); // simulated data (MLE)