From ae82c284dcc11714e39a29e11400ee79af8df02e Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx.de>
Date: Fri, 1 Mar 2013 11:52:11 -0500
Subject: [PATCH] Deleting redundant line and initializing arrays

Deleted redundant global statement and initialized arrays used
---
 matlab/prior_posterior_statistics_core.m | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/matlab/prior_posterior_statistics_core.m b/matlab/prior_posterior_statistics_core.m
index 2b0d644ee7..5eda227345 100644
--- a/matlab/prior_posterior_statistics_core.m
+++ b/matlab/prior_posterior_statistics_core.m
@@ -47,9 +47,6 @@ if nargin<4,
     whoiam=0;
 end
 
-global options_ oo_ M_ bayestopt_ estim_params_
-
-
 % Reshape 'myinputs' for local computation.
 % In order to avoid confusion in the name space, the instruction struct2local(myinputs) is replaced by:
 
@@ -132,6 +129,24 @@ if RemoteFlag==1,
     % OutputFileName_moments = {};
 end
 
+%initialize arrays
+if run_smoother
+  stock_smooth=NaN(endo_nbr,gend,MAX_nsmoo);
+  stock_update=NaN(endo_nbr,gend,MAX_nsmoo);
+  stock_innov=NaN(M_.exo_nbr,gend,MAX_ninno);  
+  stock_forcst_mean= NaN(endo_nbr,horizon+maxlag,MAX_nforc1);
+  stock_forcst_point = NaN(endo_nbr,horizon+maxlag,MAX_nforc2);
+end
+if nvn
+  stock_error = NaN(endo_nbr,gend,MAX_nerro);
+end
+if naK
+    stock_filter_step_ahead =NaN(length(options_.filter_step_ahead),endo_nbr,gend+max(options_.filter_step_ahead),MAX_naK);
+end
+stock_param = NaN(MAX_nruns,size(myinputs.x,2));
+stock_logpo = NaN(MAX_nruns,1);
+stock_ys = NaN(MAX_nruns,endo_nbr);
+
 for b=fpar:B
 
     %    [deep, logpo] = GetOneDraw(type);
-- 
GitLab