Commit e3ac1545 authored by Marco Ratto's avatar Marco Ratto
Browse files

Properly deal with dseries in identification. This fixes #781

parent 8d963104
......@@ -130,22 +130,6 @@ options_.plot_priors = 0;
options_.smoother=1;
[dataset_,dataset_info,xparam1,hh, M_, options_, oo_, estim_params_,bayestopt_]=dynare_estimation_init(M_.endo_names,fname_,1, M_, options_, oo_, estim_params_, bayestopt_);
options_ident.analytic_derivation_mode = options_.analytic_derivation_mode;
if isempty(dataset_),
dataset_.info.ntobs = periods;
dataset_.info.nvobs = length(options_.varobs);
dataset_.info.varobs = options_.varobs;
dataset_.rawdata = [];
dataset_.missing.state = 0;
for jdata=1:periods,
temp1{jdata}=[1:dataset_.info.nvobs]';
end
dataset_.missing.aindex = temp1;
dataset_.missing.vindex = [];
dataset_.missing.number_of_observations = [];
dataset_.missing.no_more_missing_observations = 1;
dataset_.descriptive.mean = [];
dataset_.data = [];
end
if prior_exist
if any(bayestopt_.pshape > 0)
......
......@@ -134,18 +134,17 @@ if info(1)==0,
options_.noprint = 1;
options_.order = 1;
options_.SpectralDensity.trigger = 0;
options_.periods = dataset_.nobs+100;
options_.periods = periods+100;
if options_.kalman_algo > 2,
options_.kalman_algo = 1;
end
analytic_derivation = options_.analytic_derivation;
options_.analytic_derivation = -2;
info = stoch_simul(char(options_.varobs));
dataset_ = dseries(oo_.endo_simul(options_.varobs_id,100+1:end),dataset_.dates(1),dataset_.names,dataset_.tex);
%data_info.data=oo_.endo_simul(options_.varobs_id,100+1:end);
% datax=data;
dataset_ = dseries(oo_.endo_simul(options_.varobs_id,100+1:end)',dates('1Q1'), options_.varobs);
derivatives_info.no_DLIK=1;
[fval,DLIK,AHess,cost_flag,ys,trend_coeff,info,M_,options_,bayestopt_,oo_] = dsge_likelihood(params',dataset_,dataset_info,options_,M_,estim_params_,bayestopt_,oo_,derivatives_info);
bounds = prior_bounds(bayestopt_,options_);
[fval,DLIK,AHess,cost_flag,ys,trend_coeff,info,M_,options_,bayestopt_,oo_] = dsge_likelihood(params',dataset_,dataset_info,options_,M_,estim_params_,bayestopt_,bounds,oo_,derivatives_info);
% fval = DsgeLikelihood(xparam1,data_info,options_,M_,estim_params_,bayestopt_,oo_);
options_.analytic_derivation = analytic_derivation;
AHess=-AHess;
......
......@@ -36,7 +36,8 @@ end
if isempty(DynareOptions.datafile) && isempty(DynareOptions.dataset.file) && isempty(DynareOptions.dataset.series)
if gsa_flag
DynareDataset = dseries();
DatasetInfo = [];
DatasetInfo = struct('missing', struct('state', 0, 'aindex', [], 'vindex', [], 'number_of_observations', NaN, 'no_more_missing_observations', NaN), ...
'descriptive', struct('mean', [], 'covariance', [], 'correlation', [], 'autocovariance', []));
newdatainterface=0;
return
else
......
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