Verified Commit ec691741 authored by Johannes Pfeifer 's avatar Johannes Pfeifer Committed by Stéphane Adjemian

Improvements to particle tests

parent 29537b76
......@@ -546,6 +546,7 @@ MODFILES += $(ECB_MODFILES)
PARTICLEFILES = \
particle/dsge_base2.mod \
particle/first_spec.mod \
particle/first_spec_MCMC.mod \
particle/local_state_space_iteration_k_test.mod
......
......@@ -2,6 +2,8 @@
@#include "first_spec_common.inc"
varobs q ca;
shocks;
var eeps = 0.04^2;
var nnu = 0.03^2;
......@@ -13,4 +15,6 @@ stoch_simul(order=3,periods=200, irf=0);
save('my_data.mat','q','ca');
estimation(datafile='my_data.mat',order=2,mode_compute=0,mh_replic=1,filter_algorithm=sis,nonlinear_filter_initialization=2);
\ No newline at end of file
estimation(datafile='my_data.mat',order=2,mode_compute=0,mh_replic=0,filter_algorithm=sis,nonlinear_filter_initialization=2
,cova_compute=0 %tell program that no covariance matrix was computed
);
\ No newline at end of file
//File testing error message if initial state vector is not positive definite
@#include "first_spec_common.inc"
varobs b ca;
shocks;
var eeps = 0.04^2;
var nnu = 0.03^2;
var b = 0.01^2;
var ca = 0.01^2;
end;
stoch_simul(order=3,periods=200, irf=0);
save('my_data_MCMC.mat','ca','b');
options_.pruning=1;
options_.particle.pruning=1;
options_.particle.number_of_particles=500;
estimation(datafile='my_data_MCMC.mat',order=2,mh_replic=100,filter_algorithm=sis,nonlinear_filter_initialization=2
,mode_compute=0 %don't compute mode
,mcmc_jumping_covariance=identity_matrix %use identity matrix
,cova_compute=0 %tell program that no covariance matrix was computed
,bayesian_irf,moments_varendo,consider_all_endogenous);
\ No newline at end of file
......@@ -20,27 +20,26 @@ model;
m = bbetaL*exp(-gbar/ies)*uaux(-1)^((ies-1)/(ies*(1-crra))-1)*u^(1/ies-crra)*c^(-1/ies)/c(-1)^(-1/ies);
b = bbar*q^eeta*exp(nnu);
c + q*b*exp(gbar) = 1 + R*b(-1);
u = ( (1-bbetaL)*c^((ies-1)/ies) + bbetaL*exp(gbar*(ies-1)/ies)*uaux^((ies-1)/(ies*(1-crra))) )^(ies/(ies-1));
u = ( (1-bbetaL)*c^((ies-1)/ies) + bbetaL*exp(gbar*(ies-1)/ies)*uaux^((ies-1)/(ies*(1-crra))))^(ies/(ies-1));
R = (1-Rpers)*Rbar + Rpers*R(-1) + eeps;
ca = b*exp(gbar)-b(-1);
end;
initval;
steady_state_model;
R = Rbar;
m = bbetaL*exp(-gbar/ies);
q = bbetaL*exp(-gbar/ies)*Rbar;
b = bbar*(bbetaL*exp(-gbar/ies)*Rbar)^eeta;
c = 1 + Rbar*bbar*(bbetaL*exp(-gbar/ies)*Rbar)^eeta - exp(gbar)*bbar*(bbetaL*exp(-gbar/ies)*Rbar)^eeta*bbetaL*exp(-gbar/ies)*Rbar;
u = ((1-bbetaL)/(1-bbetaL*exp(gbar*(ies-1)/ies )) )^(ies/(ies-1))*(1 + Rbar*bbar*(bbetaL*exp(-gbar/ies)*Rbar)^eeta - exp(gbar)*bbar*(bbetaL*exp(-gbar/ies)*Rbar)^eeta*bbetaL*exp(-gbar/ies)*Rbar);
uaux = (1 + Rbar*bbar*(bbetaL*exp(-gbar/ies)*Rbar)^eeta - exp(gbar)*bbar*(bbetaL*exp(-gbar/ies)*Rbar)^eeta*bbetaL*exp(-gbar/ies)*Rbar)^(1-crra);
uaux = u^(1-crra);
ca = (exp(gbar)-1)*bbar*(bbetaL*exp(-gbar/ies)*Rbar)^eeta;
end;
resid;
steady(solve_algo=3);
varobs q ca;
estimated_params;
ies, normal_pdf, 1.5, .2;
end;
......
......@@ -2,6 +2,8 @@
@#include "first_spec_common.inc"
varobs q ca;
shocks;
var eeps = 0.04^2;
var nnu = 0.03^2;
......
......@@ -2,6 +2,8 @@
@#include "first_spec_common.inc"
varobs q ca;
shocks;
var eeps = 0.04^2;
var nnu = 0.03^2;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment