Commit 55272c01 authored by stepan's avatar stepan
Browse files

* Cosmetic changes.

* Added verbose mode.
* Changed the initialization of the homotopic mode.



git-svn-id: https://www.dynare.org/svn/dynare/trunk@3151 ac1d8469-bf42-47a9-8791-bf33cf982152
parent c393fa92
......@@ -57,19 +57,33 @@ function time_series = extended_path(initial_conditions,sample_size,init)
covariance_matrix_upper_cholesky = chol(covariance_matrix);
tdx = M_.maximum_lag+1;
norme = 0;
% Set verbose option
verbose = 1;
for t=1:sample_size
shocks = exp(randn(1,number_of_structural_innovations)*covariance_matrix_upper_cholesky-.5*variances(positive_var_indx)');
oo_.exo_simul(tdx,positive_var_indx) = shocks;
oo_.exo_simul(tdx,positive_var_indx) = shocks;
info = perfect_foresight_simulation;
if verbose
t
info
end
if ~info.convergence
disp('homotopy')
info = homotopic_steps(tdx,positive_var_indx,shocks,0,.5);
norme
info = homotopic_steps(tdx,positive_var_indx,shocks,norme,.5);
if verbose
info
end
else
norme = sqrt(sum((shocks-1).^2,2));
end
if ~info.convergence
disp('merdre!')
error('I am not able to simulate this model!')
end
time_series(:,t+1) = oo_.endo_simul(:,tdx);
time_series(:,t+1) = oo_.endo_simul(:,tdx);
oo_.endo_simul(:,1:end-1) = oo_.endo_simul(:,2:end);
oo_.endo_simul(:,end) = oo_.steady_state;
end
......
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