Skip to content
Snippets Groups Projects
Verified Commit 42997769 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Specialize mod file for linear Kalman filter.

The value of the likelihood at the mod will be used to test various
nonlinear filters.
parent 8ba79da8
Branches
Tags
No related merge requests found
var x y;
varexo u v;
varexo v;
parameters c, r;
parameters r;
c = .500;
r = .975;
model;
y = x + u;
x = r*x(-1) + 0.0000001*x(1) + v;
y = x;
x = r*x(-1) + v;
end;
shocks;
var u; stderr sqrt(0.02);
var v; stderr sqrt(0.02);
var v; stderr sqrt(0.02);
end;
steady;
check;
stoch_simul(irf=0, periods=10000);
datatomfile('noisy_ar1_data');
stoch_simul(irf=0,periods=0,order=2);
estimated_params;
c, .500;
r, .975;
stderr u, sqrt(.2);
stderr v, sqrt(.02);
r, .975, uniform_pdf,,,0,1;
stderr y, sqrt(.2), uniform_pdf,,,0,1;
stderr v, sqrt(.02), uniform_pdf,,,0,1;
end;
varobs y;
particle = 1;
if particle;
options_.particle.status = 1;
options_.particle.initialization = 1;
options_.particle.pruning = false;
options_.particle.number_of_particles = 20000;
options_.particle.resampling.status = 'systematic';
options_.particle.resampling.neff_threshold = .1;
options_.gstep(1) = 1e-4;
options_.gstep(2) = .1;
options_.mode_check_neighbourhood_size = 0.05;
estimation(nobs=100,datafile=noisy_ar1_data,mh_replic=0, mode_compute=4, mode_check);
set_dynare_threads('local_state_space_iteration_2',3);
copyfile('noisy_ar1/Output/noisy_ar1_mode.mat', 'noisy.mat')
estimation(order=2,nobs=100,datafile=linear_model_data,mh_replic=0,filter_algorithm=sis);
else;
estimation(nobs=100,datafile=noisy_ar1_data,mh_replic=0);
end;
ovalue = oo_.posterior.optimization.log_density;
save('optimal_value_with_linear_kalman_filter', 'ovalue')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment