Commit c8d0ea4f authored by sebastien's avatar sebastien
Browse files

v4 tests: added Ferhat's test files


git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1192 ac1d8469-bf42-47a9-8791-bf33cf982152
parent 5c285d6f
%
% Status : main Dynare file
%
% Warning : this file is generated automatically by Dynare
% from model file (.mod)
clear all
tic;
global M_ oo_ exedet_ exdet_ recur_ recurs_
global options_ endval_
global ys0_ recurs0_ ex0_ ct_
options_ = [];
M_.fname = 'bidon';
%
% Some global variables initialisation
%
global_initialization;
diary off;
warning off;
delete bidon.log;
warning on;
warning backtrace;
logname_ = 'bidon.log';
diary 'bidon.log';
erase_compiled_function('bidon_static');
erase_compiled_function('bidon_dynamic');
M_.exo_names = 'g_bar';
M_.exo_names_tex = '';
M_.endo_names = 'c';
M_.endo_names_tex = '';
M_.endo_names = strvcat(M_.endo_names,'i');
M_.endo_names_tex = strvcat(M_.endo_names_tex,'');
M_.endo_names = strvcat(M_.endo_names,'g');
M_.endo_names_tex = strvcat(M_.endo_names_tex,'');
M_.endo_names = strvcat(M_.endo_names,'infl');
M_.endo_names_tex = strvcat(M_.endo_names_tex,'');
M_.endo_names = strvcat(M_.endo_names,'y');
M_.endo_names_tex = strvcat(M_.endo_names_tex,'');
M_.endo_names = strvcat(M_.endo_names,'k');
M_.endo_names_tex = strvcat(M_.endo_names_tex,'');
M_.endo_names = strvcat(M_.endo_names,'l');
M_.endo_names_tex = strvcat(M_.endo_names_tex,'');
M_.endo_names = strvcat(M_.endo_names,'r');
M_.endo_names_tex = strvcat(M_.endo_names_tex,'');
M_.endo_names = strvcat(M_.endo_names,'p1');
M_.endo_names_tex = strvcat(M_.endo_names_tex,'');
M_.endo_names = strvcat(M_.endo_names,'q1');
M_.endo_names_tex = strvcat(M_.endo_names_tex,'');
M_.endo_names = strvcat(M_.endo_names,'p2');
M_.endo_names_tex = strvcat(M_.endo_names_tex,'');
M_.endo_names = strvcat(M_.endo_names,'q2');
M_.endo_names_tex = strvcat(M_.endo_names_tex,'');
M_.endo_names = strvcat(M_.endo_names,'r0');
M_.endo_names_tex = strvcat(M_.endo_names_tex,'');
M_.param_names = 'a';
M_.param_names_tex = '';
M_.param_names = strvcat(M_.param_names,'b');
M_.param_names_tex = strvcat(M_.param_names_tex,'');
M_.param_names = strvcat(M_.param_names,'d');
M_.param_names_tex = strvcat(M_.param_names_tex,'');
M_.param_names = strvcat(M_.param_names,'e');
M_.param_names_tex = strvcat(M_.param_names_tex,'');
M_.param_names = strvcat(M_.param_names,'f');
M_.param_names_tex = strvcat(M_.param_names_tex,'');
M_.param_names = strvcat(M_.param_names,'h');
M_.param_names_tex = strvcat(M_.param_names_tex,'');
M_.param_names = strvcat(M_.param_names,'j');
M_.param_names_tex = strvcat(M_.param_names_tex,'');
M_.param_names = strvcat(M_.param_names,'m');
M_.param_names_tex = strvcat(M_.param_names_tex,'');
M_.param_names = strvcat(M_.param_names,'n');
M_.param_names_tex = strvcat(M_.param_names_tex,'');
M_.param_names = strvcat(M_.param_names,'o');
M_.param_names_tex = strvcat(M_.param_names_tex,'');
M_.param_names = strvcat(M_.param_names,'p');
M_.param_names_tex = strvcat(M_.param_names_tex,'');
M_.param_names = strvcat(M_.param_names,'q');
M_.param_names_tex = strvcat(M_.param_names_tex,'');
M_.exo_det_nbr = 0;
M_.exo_nbr = 1;
M_.Sigma_e = zeros(1, 1);
M_.endo_nbr = 13;
M_.recur_nbr = 0;
M_.param_nbr = 12;
M_.lead_lag_incidence = [
0 2 5 18 0;
0 0 6 0 0;
0 0 7 0 0;
0 0 8 0 0;
1 3 9 19 20;
0 4 10 0 0;
0 0 11 0 0;
0 0 12 0 0;
0 0 13 0 0;
0 0 14 0 0;
0 0 15 0 0;
0 0 16 0 0;
0 0 17 0 0;]';
M_.exo_names_orig_ord = [1:1];
M_.maximum_lag = 10;
M_.maximum_lead = 2;
M_.maximum_endo_lag = 2;
M_.maximum_endo_lead = 2;
oo_.steady_state = zeros(13, 1);
M_.maximum_exo_lag = 10;
M_.maximum_exo_lead = 0;
oo_.exo_steady_state = zeros(1, 1);
M_.params = zeros(12, 1);
M_.params( 1 ) = (0.4*0.6);
a = M_.params( 1 );
M_.params( 2 ) = (0.3*0.6);
b = M_.params( 2 );
M_.params( 3 ) = 0.1;
d = M_.params( 3 );
M_.params( 4 ) = 0.15;
e = M_.params( 4 );
M_.params( 5 ) = 1;
f = M_.params( 5 );
M_.params( 6 ) = 0.15;
h = M_.params( 6 );
M_.params( 7 ) = 1;
j = M_.params( 7 );
M_.params( 8 ) = 1;
m = M_.params( 8 );
M_.params( 9 ) = 1;
n = M_.params( 9 );
M_.params( 10 ) = 1;
o = M_.params( 10 );
%
% INITVAL instructions
%
options_.initval_file = 0;
endval_=0;
oo_.exo_steady_state( 1 ) = 0.15;
oo_.steady_state( 1 ) = 0.7;
oo_.steady_state( 2 ) = 0.15;
oo_.steady_state( 3 ) = 0.15;
oo_.steady_state( 5 ) = 1;
oo_.steady_state( 6 ) = 1;
oo_.steady_state( 7 ) = 1;
oo_.steady_state( 4 ) = 0.02;
oo_.steady_state( 8 ) = 0;
oo_.steady_state( 13 ) = oo_.steady_state(8);
oo_.steady_state( 9 ) = (2/3);
oo_.steady_state( 10 ) = (3.1/3);
oo_.steady_state( 12 ) = (4/9);
oo_.steady_state( 11 ) = (8/9);
oo_.y_simul=[oo_.steady_state*ones(1,M_.maximum_lag)];
if M_.exo_nbr > 0;
oo_.exo_simul = [ones(M_.maximum_lag,1)*oo_.exo_steady_state'];
end;
if M_.exo_det_nbr > 0;
oo_.exo_det_simul = [ones(M_.maximum_lag,1)*oo_.exo_det_steady_state'];
end;
options_.solve_algo = 2;
steady;
options_.periods = 100;
options_.simul = 1;
if ~ options_.initval_file
make_y_;
make_ex_;
end
disp('compiling...');
mex bidon_dynamic.cc;
oo_.endo_simul=bidon_dynamic;
var_list_=[];
var_list_ = strvcat(var_list_,'c');
rplot(var_list_);
var_list_=[];
var_list_ = strvcat(var_list_,'y');
rplot(var_list_);
save('bidon_results', 'oo_');
diary off
disp(['Total computing time : ' sec2hms(round(toc)) ]);
var c i g infl y k l r p1 q1 p2 q2 r0;
varexo g_bar;
parameters a b d e f h j m n o p q;
a=0.4*0.6;
b=0.3*0.6;
d=0.1;
e=0.15;
f=1;
h=0.15;
j=1;
m=1;
n=1;
o=1;
model(SPARSE_DLL,gcc_compiler);
/*0*/ k=(1-h)*k(-1)+i; /*k:0*/
/*1*/ y=l^j*k^m; /*l:1*/
/*2*/ c=y*a+b+0.3*c(-1)+0.1*c(+1)+0.*g_bar(-10); /*c:2*/
/*3*/ infl=0.02*y+0.5*r; /*infl:3*/
/*4*/ i=d*(y-y(-1))+e/**r*/; /*i4*/
/*5*/ g=f*g_bar; /*g:5*/
/*6*/ y=0.6*(c+i+g)+0.1*y(-2)+0.1*y(+2)+0.1*y(-1)+0.1*y(+1); /*y:6*/
/*7*/ r=y-1+infl-0.02; /*r7*/
/*8*/ p1=i+0.5*q1;
/*9*/ q1=0.5*p1+c;
/*10*/ q2=0.5*p2+r0;
/*11*/ p2=0.5*q2+p1;
/*12*/ r0=r;
end;
initval;
g_bar=0.15;
c=0.7;
i=0.15;
g=0.15;
y=1;
k=1;
l=1;
infl=0.02;
r=0;
r0=r;
p1=2/3;
q1=3.1/3;
q2=4/9;
p2=8/9;
end;
steady(solve_algo=2);
//check;
/*shocks;
var g_bar;
periods 1;
values 0.16;
end;*/
simul(periods=100);
rplot c;
rplot y;
/*
* pctimer.h 1.1 02/03/05
*
* Uses Win32 performance counter functions to get a high-resolution timer
*
* By Wu Yongwei
*
*/
#ifndef _PCTIMER_H
typedef double pctimer_t;
#if defined(_WIN32) || defined(__CYGWIN__)
#ifndef _WIN32
#define PCTIMER_NO_WIN32
#endif /* _WIN32 */
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#ifdef PCTIMER_NO_WIN32
#undef PCTIMER_NO_WIN32
#undef _WIN32
#endif /* PCTIMER_NO_WIN32 */
__inline pctimer_t pctimer()
{
static LARGE_INTEGER pcount, pcfreq;
static int initflag;
if (!initflag)
{
QueryPerformanceFrequency(&pcfreq);
initflag++;
}
QueryPerformanceCounter(&pcount);
return (double)pcount.QuadPart / (double)pcfreq.QuadPart;
}
#else /* Win32/Cygwin */
#include <sys/time.h>
__inline pctimer_t pctimer()
{
struct timeval tv;
gettimeofday(&tv, NULL);
return (double)tv.tv_sec + (double)tv.tv_usec / 1000000;
}
#endif /* Win32/Cygwin */
#endif /* _PCTIMER_H */
var c k;
varexo x;
parameters alph gam delt bet aa;
alph=0.5;
gam=0.5;
delt=0.02;
bet=0.05;
aa=0.5;
model/*(SPARSE_DLL,GCC_COMPILER)*/;
c + k - aa*x*k(-1)^alph - (1-delt)*k(-1);
c^(-gam) - (1+bet)^(-1)*(aa*alph*x(+1)*k^(alph-1) + 1 - delt)*c(+1)^(-gam);
end;
initval;
x = 1;
k = ((delt+bet)/(1.0*aa*alph))^(1/(alph-1));
c = aa*k^alph-delt*k;
end;
steady(solve_algo=2);
//check;
shocks;
var x;
periods 1;
values 1.2;
end;
simul(periods=200);
rplot c;
rplot k;
// check shocks on several periods
var c k;
varexo x;
parameters alph gam delt bet aa;
alph=0.5;
gam=0.5;
delt=0.02;
bet=0.05;
aa=0.5;
model;
c + k - aa*x*k(-1)^alph - (1-delt)*k(-1);
c^(-gam) - (1+bet)^(-1)*(aa*alph*x(+1)*k^(alph-1) + 1 - delt)*c(+1)^(-gam);
end;
initval;
x = 1;
k = ((delt+bet)/(1.0*aa*alph))^(1/(alph-1));
c = aa*k^alph-delt*k +1 ;
end;
steady;
check;
shocks;
var x;
periods 1 2 3 4;
values 1.1 1.2 1.3 1.4;
end;
simul(periods=200);
rplot c;
rplot k;
This diff is collapsed.
This diff is collapsed.
Supports Markdown
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