%
% Status : main Dynare file 
%
% Warning : this file is generated automatically by Dynare
%           from model file (.mod)

clear all
tic;
global M_ oo_ options_ ys0_ ex0_
options_ = [];
M_.fname = 'invmod1';
%
% Some global variables initialization
%
global_initialization;
diary off;
logname_ = 'invmod1.log';
if exist(logname_, 'file')
    delete(logname_)
end
diary(logname_)
M_.exo_names = 'n';
M_.exo_names_tex = 'n';
M_.exo_names = char(M_.exo_names, 'r');
M_.exo_names_tex = char(M_.exo_names_tex, 'r');
M_.exo_names = char(M_.exo_names, 'w');
M_.exo_names_tex = char(M_.exo_names_tex, 'w');
M_.endo_names = 'p';
M_.endo_names_tex = 'p';
M_.endo_names = char(M_.endo_names, 'h');
M_.endo_names_tex = char(M_.endo_names_tex, 'h');
M_.endo_names = char(M_.endo_names, 'x');
M_.endo_names_tex = char(M_.endo_names_tex, 'x');
M_.endo_names = char(M_.endo_names, 'A');
M_.endo_names_tex = char(M_.endo_names_tex, 'A');
M_.endo_names = char(M_.endo_names, 'eps');
M_.endo_names_tex = char(M_.endo_names_tex, 'eps');
M_.endo_names = char(M_.endo_names, 'xi');
M_.endo_names_tex = char(M_.endo_names_tex, 'xi');
M_.endo_names = char(M_.endo_names, 'pii');
M_.endo_names_tex = char(M_.endo_names_tex, 'pii');
M_.endo_names = char(M_.endo_names, 'q');
M_.endo_names_tex = char(M_.endo_names_tex, 'q');
M_.endo_names = char(M_.endo_names, 'k');
M_.endo_names_tex = char(M_.endo_names_tex, 'k');
M_.endo_names = char(M_.endo_names, 'AUX_EXO_LEAD_61');
M_.endo_names_tex = char(M_.endo_names_tex, 'AUX\_EXO\_LEAD\_61');
M_.endo_names = char(M_.endo_names, 'AUX_EXO_LEAD_77');
M_.endo_names_tex = char(M_.endo_names_tex, 'AUX\_EXO\_LEAD\_77');
M_.endo_names = char(M_.endo_names, 'AUX_EXO_LAG_10_0');
M_.endo_names_tex = char(M_.endo_names_tex, 'AUX\_EXO\_LAG\_10\_0');
M_.param_names = 'phi';
M_.param_names_tex = 'phi';
M_.param_names = char(M_.param_names, 'sigma');
M_.param_names_tex = char(M_.param_names_tex, 'sigma');
M_.param_names = char(M_.param_names, 'rho');
M_.param_names_tex = char(M_.param_names_tex, 'rho');
M_.param_names = char(M_.param_names, 'gam');
M_.param_names_tex = char(M_.param_names_tex, 'gam');
M_.param_names = char(M_.param_names, 'bet');
M_.param_names_tex = char(M_.param_names_tex, 'bet');
M_.param_names = char(M_.param_names, 'delta');
M_.param_names_tex = char(M_.param_names_tex, 'delta');
M_.param_names = char(M_.param_names, 'theta');
M_.param_names_tex = char(M_.param_names_tex, 'theta');
M_.param_names = char(M_.param_names, 'omega');
M_.param_names_tex = char(M_.param_names_tex, 'omega');
M_.param_names = char(M_.param_names, 'psi');
M_.param_names_tex = char(M_.param_names_tex, 'psi');
M_.param_names = char(M_.param_names, 'lambda');
M_.param_names_tex = char(M_.param_names_tex, 'lambda');
M_.exo_det_nbr = 0;
M_.exo_nbr = 3;
M_.endo_nbr = 12;
M_.param_nbr = 10;
M_.orig_endo_nbr = 9;
M_.aux_vars(1).endo_index = 10;
M_.aux_vars(1).type = 2;
M_.aux_vars(2).endo_index = 11;
M_.aux_vars(2).type = 2;
M_.aux_vars(3).endo_index = 12;
M_.aux_vars(3).type = 3;
M_.aux_vars(3).orig_index = 2;
M_.aux_vars(3).orig_lead_lag = 0;
M_.Sigma_e = zeros(3, 3);
M_.H = 0;
options_.block=0;
options_.bytecode=0;
options_.use_dll=0;
erase_compiled_function('invmod1_dynamic');
M_.lead_lag_incidence = [
 1 6 0;
 0 7 0;
 0 8 18;
 2 9 0;
 0 10 0;
 0 11 19;
 3 12 20;
 0 13 0;
 4 14 0;
 0 15 21;
 0 16 22;
 5 17 0;]';
M_.equations_tags = {
};
M_.exo_names_orig_ord = [1:3];
M_.maximum_lag = 1;
M_.maximum_lead = 1;
M_.maximum_endo_lag = 1;
M_.maximum_endo_lead = 1;
oo_.steady_state = zeros(12, 1);
M_.maximum_exo_lag = 0;
M_.maximum_exo_lead = 0;
oo_.exo_steady_state = zeros(3, 1);
M_.params = NaN(10, 1);
M_.NNZDerivatives = zeros(3, 1);
M_.NNZDerivatives(1) = 46;
M_.NNZDerivatives(2) = 79;
M_.NNZDerivatives(3) = -1;
M_.params( 1 ) = 0.1;
phi = M_.params( 1 );
M_.params( 2 ) = 0.25;
sigma = M_.params( 2 );
M_.params( 3 ) = 2.5;
rho = M_.params( 3 );
M_.params( 4 ) = 0.75;
gam = M_.params( 4 );
M_.params( 5 ) = 0.99;
bet = M_.params( 5 );
M_.params( 6 ) = 0.2;
delta = M_.params( 6 );
M_.params( 7 ) = 0.05;
theta = M_.params( 7 );
M_.params( 8 ) = 0.99;
omega = M_.params( 8 );
M_.params( 9 ) = 0.25;
psi = M_.params( 9 );
M_.params( 10 ) = 19.88775;
lambda = M_.params( 10 );
 
 
%
% INITVAL instructions
%
options_.initval_file = 0;
oo_.steady_state( 5 ) = 2.2817;
oo_.steady_state( 6 ) = 0.087326;
oo_.steady_state( 1 ) = 0.38951;
oo_.steady_state( 9 ) = 1;
oo_.steady_state( 2 ) = 82.944;
oo_.steady_state( 3 ) = 79.551;
oo_.steady_state( 4 ) = 118.59;
oo_.steady_state( 7 ) = 1;
oo_.steady_state( 8 ) = 19.88775;
oo_.steady_state(12)=oo_.exo_steady_state(2);
oo_.steady_state(10)=oo_.steady_state(3)*(oo_.steady_state(1)*(oo_.steady_state(5)-1)-oo_.steady_state(5)*(M_.params(5)*(M_.params(6)*oo_.steady_state(7)+oo_.exo_steady_state(2)*(1-M_.params(6)))-oo_.exo_steady_state(2)));
oo_.steady_state(11)=oo_.steady_state(3)*oo_.steady_state(6)*M_.params(5)*(oo_.exo_steady_state(2)*(1-M_.params(6))+oo_.steady_state(1)*M_.params(6));
oo_.endo_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;
%
% SHOCKS instructions
%
make_ex_;
M_.exo_det_length = 0;
M_.Sigma_e(1, 1) = (0.01)^2;
M_.sigma_e_is_diagonal = 1;
var_list_=[];
info = stoch_simul(var_list_);
save('invmod1_results.mat', 'oo_', 'M_', 'options_');
diary off

disp(['Total computing time : ' dynsec2hms(toc) ]);
