I ran into a parameter initial value out of bounds problem but I can’t seem to locate the source of error.
My code is:
%Holston-Laubach-Williams 2017
var y pi y_star g z;
varexo y_gap_e pi_e y_star_e g_e z_e r;
varobs y pi;
parameters root1, root2, a_r, b_pi, b_y;
% parameters a_y1, a_y2, a_r, b_pi, b_y;
% y
% a_y1=1.5;
% a_y2=-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))
a_r=-0.071;
% pi
b_pi=0;
b_y=0.079;
%==============================================
% model specification
%==============================================
model(linear);
# a_y1=(root1+root2);
# a_y2=- root1*root2;
% y
y=y_star+a_y1*(y(-1)-y_star(-1)) + a_y2*(y(-2)-y_star(-2)) + a_r*(r(-1)-(4*g(-1)+z(-1))+r(-2)-(4*g(-2)+z(-2))) + y_gap_e;
% pi
pi=b_pi*pi(-1) + (1-b_pi)*1/3*(pi(-2)+pi(-3)+pi(-4))+b_y*(y(-1)-y_star(-1)) + pi_e;
%-----------------------------------------
% state equations
%-----------------------------------------
% r_star
% r_star = 4 * g + z; % adj to have per annum as unit for g
% z
z = z(-1) + z_e;
% g
g = g(-1) + g_e;
% y_star
y_star = y_star(-1) + g(-1) + y_star_e;
end;
%==============================================
% stationary state (as starting point for estimation)
%==============================================
steady_state_model;
y=811.2;
y_star=811.2;
g=r/4;
z=0;
end;
steady;
check;
stoch_simul(order=2);
%==============================================
% parameters to estimate
%==============================================
estimated_params;
% y
% a_y1, 1.5, 1, 2, uniform_pdf, 1.5, 0.083;
% a_y2, -0.5, -1, 0, uniform_pdf, -0.5, 0.083;
root1, 0.95, -0.9999, 0.9999, uniform_pdf, 0, sqrt(3)^(-1)*1.9998;
root2, 0.55, -0.9999, 0.9999, uniform_pdf, 0, sqrt(3)^(-1)*1.9998;
a_r, -0.1, -1, -0.0025, uniform_pdf, -0.50125, 0.083;
% pi
b_y,0.5, 0.025, 2, uniform_pdf, 1.0125, 0.325;
b_pi, 0.5, 0, 1, uniform_pdf, 0.5, 0.083;
stderr y_gap_e, 0.4, inv_gamma_pdf, 0.67, 0.22;
stderr pi_e, 0.75, inv_gamma_pdf, 0.67, 0.22;
stderr z_e, 0.3, inv_gamma_pdf, 0.3, 0.22;
stderr y_star_e, 0.5, inv_gamma_pdf, 0.67, 0.22;
stderr g_e, 0.1, inv_gamma_pdf, 0.1, 0.22;
end;
%==============================================
% parameters initialization
%==============================================
filter_initial_state;
% y_star(0)=811.207;
y_star(0)=810.0437;
y_star(-1)=808.886747;
g(0)=1.1607;
g(-1)=1.1606;
z(0)=0;
z(-1)=0;
end;
%==============================================
% Estimation
%==============================================
% identification(diffuse_filter);
estimation(datafile='../../data/HLW_data.csv',
dirname='../HLW_output/',
% mode_check,
first_obs=5, % needs to be larger than # of lags
mode_compute=6, % do MCMC
diffuse_filter, % to estimate models with non-stationary observed variables
kalman_algo=3, % use Multivariate Diffuse Kalman Filter for non-stationary models
consider_all_endogenous,
% smoothed_state_uncertainty, % computation of the variance of smoothed estimates, i.e. varT(yt)
smoother,
prior_trunc=0,
mh_replic=50000,
mh_nblocks=2,
mh_drop=0.5,
mh_conf_sig=0.95,
plot_priors=0,
nodisplay,
graph_format=pdf);
The error message is
Initial value(s) of a_r are outside parameter bounds. Potentially, you should set prior_trunc=0. If
you used the mode_file-option, check whether your mode-file is consistent with the priors.
The initial value I’ve set for a_r is within the bounds, so I’m quite confused about what went wrong. I apologize in advance if it turns out to be a dynare syntax issue I had overlooked, but I’ve stared at this for a while and am still stuck. Many thanks.
P.S. I’m using dynare 4.7 unstable for its feature on setting Kalman filter initial values.
HLW_data.csv (11.9 KB)