From 62e28dac94f9427e5f559bf18aaeb809603a562b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Scylla=29?= <stephane.adjemian@univ-lemans.fr> Date: Thu, 26 Jun 2014 10:55:54 +0200 Subject: [PATCH] Use makedataset in condition forecast routine. --- matlab/imcforecast.m | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/matlab/imcforecast.m b/matlab/imcforecast.m index 2fa56a2bac..766394fbc4 100644 --- a/matlab/imcforecast.m +++ b/matlab/imcforecast.m @@ -102,30 +102,13 @@ if estimated_model error('imcforecast:: The dimension of the vector of parameters doesn''t match the number of estimated parameters!') end end - set_parameters(xparam); - - % Load and transform data. - transformation = []; - if options_.loglinear && ~options_.logdata - transformation = @log; - end - xls.sheet = options_.xls_sheet; - xls.range = options_.xls_range; - - if ~isfield(options_,'nobs') - options_.nobs = []; - end - - dataset_ = initialize_dataset(options_.datafile,options_.varobs,options_.first_obs,options_.nobs,transformation,options_.prefilter,xls); - - data = dataset_.data; - data_index = dataset_.missing.aindex; - gend = options_.nobs; - missing_value = dataset_.missing.state; - + [dataset_,dataset_info] = makedataset(options_); + data = transpose(dataset_.data); + data_index = dataset_info.missing.aindex; + gend = dataset_.nobs; + missing_value = dataset_info.missing.state; [atT,innov,measurement_error,filtered_state_vector,ys,trend_coeff] = DsgeSmoother(xparam,gend,data,data_index,missing_value); - trend = repmat(ys,1,options_cond_fcst.periods+1); for i=1:M_.endo_nbr j = strmatch(deblank(M_.endo_names(i,:)),options_.varobs,'exact'); @@ -134,7 +117,6 @@ if estimated_model end end trend = trend(oo_.dr.order_var,:); - InitState(:,1) = atT(:,end); else InitState(:,1) = zeros(M_.endo_nbr,1); -- GitLab