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

Add integration test for SIS (particle filter).

We verify that, in a linear model, the likelihood value obtained using
the SIS algorithm is equal to the likelihood value calculated with a
standard linear Kalman filter.
parent 940d9fa5
Branches
No related tags found
No related merge requests found
......@@ -1792,6 +1792,9 @@ mod_and_m_tests = [
{ 'test' : [ 'ecb/pooled_fgls/test_param_names.mod' ] },
# Particle files
{ 'test' : [ 'particle/noisy_ar1.mod',
'particle/noisy_ar1_nlf_sis.mod'],
'extra' : [ 'particle/noisy_ar1_data.m'] },
{ 'test' : [ 'particle/dsge_base2.mod' ],
'extra' : [ 'particle/risky.m',
'particle/extreme.m',
......
This diff is collapsed.
var x y;
varexo v;
parameters r;
r = .975;
model;
y = x;
x = r*x(-1) + v;
end;
shocks;
var v; stderr sqrt(0.02);
end;
steady;
check;
estimated_params;
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;
options_.particle.status = 1; // Required because we intend to use a nonlinear filter with a linear model
estimation(nobs=100,
mode_compute=0,
mh_replic=0,
cova_compute=0,
mode_file=noisy,
datafile=noisy_ar1_data,
order=1,
resampling=systematic,
number_of_particles = 5000000,
filter_algorithm=sis);
load optimal_value_with_linear_kalman_filter
if 100*abs((oo_.likelihood_at_initial_parameters-(-ovalue))/(-ovalue))>0.05
error('Difference between SIS and linear Kalman filter is bigger than 0.05%%')
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment