From 1a6afc0fdbad28d9a0cfc6c282ec829a6bfff687 Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Sat, 11 Apr 2015 08:56:59 +0200 Subject: [PATCH] Restore compatibility of recursive estimation with new data interface Use dataset_ structure instead of reconstructing data to plot. Eliminates crashes --- matlab/dynare_estimation.m | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/matlab/dynare_estimation.m b/matlab/dynare_estimation.m index 348bdf8c4..ba49a1c18 100644 --- a/matlab/dynare_estimation.m +++ b/matlab/dynare_estimation.m @@ -28,7 +28,7 @@ function oo_recursive_=dynare_estimation(var_list,dname) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see . -global options_ oo_ M_ +global options_ oo_ M_ dataset_ oo_recursive_={}; @@ -97,14 +97,6 @@ end if nnobs > 1 && horizon > 0 mh_replic = options_.mh_replic; - rawdata = read_variables(options_.datafile,options_.varobs,[],options_.xls_sheet,options_.xls_range); - gend = options_.nobs; - data_plot_end_point=min(options_.first_obs+gend-1+horizon,size(rawdata,1)); %compute last observation that can be plotted - rawdata = rawdata(options_.first_obs:data_plot_end_point,:); - % Take the log of the variables if needed - if options_.loglinear && ~options_.logdata % and if the data are not in logs, then... - rawdata = log(rawdata); - end endo_names = M_.endo_names; n_varobs = length(options_.varobs); @@ -132,11 +124,12 @@ if nnobs > 1 && horizon > 0 IdObs(j,1) = iobs; end end - + + gend = dataset_.nobs; time_offset=min(3,gend-1); %for observables, plot 3 previous periods unless data is shorter k = time_offset+min(nobs(end)-nobs(1)+horizon, ... - size(rawdata,1)-nobs(1)); - data2 = rawdata(end-k+1:end,:); + size(dataset_.data,1)-nobs(1)); + data2 = dataset_.data(end-k+1:end,:); [nbplt,nr,nc,lr,lc,nstar] = pltorg(nvar); m = 1; plot_index=0;