From 230e787b27f034b248942be7488cdc6ff77dbcc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= <stephane.adjemian@univ-lemans.fr> Date: Mon, 12 Dec 2011 14:46:13 +0100 Subject: [PATCH] Fixed bug. The seed has to be set before the sampling of the structural innovations. --- matlab/ep/extended_path.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/matlab/ep/extended_path.m b/matlab/ep/extended_path.m index 1340bbcad1..4ed7852124 100644 --- a/matlab/ep/extended_path.m +++ b/matlab/ep/extended_path.m @@ -88,6 +88,11 @@ covariance_matrix = M_.Sigma_e(positive_var_indx,positive_var_indx); number_of_structural_innovations = length(covariance_matrix); covariance_matrix_upper_cholesky = chol(covariance_matrix); +% Set seed. +if options_.ep.set_dynare_seed_to_default + set_dynare_seed('default'); +end + % Simulate shocks. switch options_.ep.innovation_distribution case 'gaussian' @@ -99,11 +104,6 @@ end % Initializes some variables. t = 0; -% Set seed. -if options_.ep.set_dynare_seed_to_default - set_dynare_seed('default'); -end - graphic_waitbar_flag = ~( options_.console_mode || exist('OCTAVE_VERSION') ); % Set waitbar (graphic mode) @@ -116,7 +116,7 @@ else back = []; end end - + % Main loop. while (t<sample_size) -- GitLab