Removed "Do pure Lyapunov tests" section.

This should be done in the lyapunov_symm routine.
time-shift
Stéphane Adjemian (Karaba) 2014-10-13 17:07:32 +02:00
parent 97b63105a0
commit f99fcfa27f
1 changed files with 1 additions and 65 deletions

View File

@ -133,68 +133,4 @@ end
options_.lyapunov_fp = 0;
options_.lyapunov_db = 0;
options_.lyapunov_srs = 0;
estimation(lyapunov=fixed_point,order=1,datafile=fsdat_simul, nobs=192, loglinear, mh_replic=0, mh_nblocks=1, mh_jscale=0.8,nograph);
//**************** Do pure Lyapunov tests***********
verbatim;
clear all
options_.lyapunov_complex_threshold = 1e-15;
options_.qz_zero_threshold = 1e-6;
options_.qz_criterium=1-options_.qz_zero_threshold;
options_.lyapunov_fixed_point_tol = 1e-10;
options_.lyapunov_doubling_tol = 1e-16;
n_small=8;
m_small=10;
T_small=randn(n_small,n_small);
T_small=0.99*T_small/max(abs(eigs(T_small)));
tmp2=randn(m_small,m_small);
Q_small=tmp2*tmp2';
R_small=randn(n_small,m_small);
n_large=9;
m_large=11;
T_large=randn(n_large,n_large);
T_large=0.99*T_large/max(abs(eigs(T_large)));
tmp2=randn(m_large,m_large);
Q_large=tmp2*tmp2';
R_large=randn(n_large,m_large);
% DynareOptions.lyapunov_fp == 1
Pstar1_small = lyapunov_symm(T_small,R_small*Q_small*R_small',options_.lyapunov_fixed_point_tol,options_.lyapunov_fixed_point_tol,3);
Pstar1_large = lyapunov_symm(T_large,R_large*Q_large*R_large',options_.lyapunov_fixed_point_tol,options_.lyapunov_fixed_point_tol,3);
% Dynareoptions.lyapunov_db == 1
Pstar2_small = disclyap_fast(T_small,R_small*Q_small*R_small',options_.lyapunov_doubling_tol);
Pstar2_large = disclyap_fast(T_large,R_large*Q_large*R_large',options_.lyapunov_doubling_tol);
% Dynareoptions.lyapunov_srs == 1
Pstar3_small = lyapunov_symm(T_small,Q_small,options_.lyapunov_fixed_point_tol,options_.lyapunov_complex_threshold,4,R_small);
Pstar3_large = lyapunov_symm(T_large,Q_large,options_.lyapunov_fixed_point_tol,options_.lyapunov_complex_threshold,4,R_large);
% Standard
Pstar4_small = lyapunov_symm(T_small,R_small*Q_small*R_small',options_.qz_criterium,options_.lyapunov_complex_threshold);
Pstar4_large = lyapunov_symm(T_large,R_large*Q_large*R_large',options_.qz_criterium,options_.lyapunov_complex_threshold);
if max(max(abs(Pstar1_small-Pstar2_small)))>1e-8
error('Results do not match')
end
if max(max(abs(Pstar1_small-Pstar3_small)))>1e-8
error('Results do not match')
end
if max(max(abs(Pstar1_small-Pstar4_small)))>1e-8
error('Results do not match')
end
if max(max(abs(Pstar1_large-Pstar2_large)))>1e-8
error('Results do not match')
end
if max(max(abs(Pstar1_large-Pstar3_large)))>1e-8
error('Results do not match')
end
if max(max(abs(Pstar1_large-Pstar4_large)))>1e-8
error('Results do not match')
end
oo_=[];
M_=[];
end;
estimation(lyapunov=fixed_point,order=1,datafile=fsdat_simul, nobs=192, loglinear, mh_replic=0, mh_nblocks=1, mh_jscale=0.8,nograph);