Commit 88be4fa3 authored by MichelJuillard's avatar MichelJuillard

fixing bug in prior_posterior_statistics.m and in recursive estimation

parent 7dde5919
......@@ -56,7 +56,8 @@ M_.dname = dname;
if nnobs > 1
for i=1:nnobs
options_.nobs = nobs(i);
dynare_estimation_1(var_list,[dname '_' int2str(nobs(i))]);
M_.dname = [dname '_' int2str(nobs(i))];
dynare_estimation_1(var_list,M_.dname);
oo_recursive_{nobs(i)} = oo_;
end
else
......
......@@ -801,7 +801,7 @@ if (any(bayestopt_.pshape >0 ) && options_.mh_replic) || ...
oo_ = compute_moments_varendo('posterior',options_,M_,oo_,var_list_);
end
if options_.smoother || ~isempty(options_.filter_step_ahead) || options_.forecast
prior_posterior_statistics('posterior',dataset_.data,dataset_.info.ntobs,dataset_.missing.aindex,dataset_.missing.state);
prior_posterior_statistics('posterior',dataset_);
end
xparam = get_posterior_parameters('mean');
set_all_parameters(xparam);
......
......@@ -239,7 +239,7 @@ if options_gsa.rmse,
end
if isempty(a),
% dynare_MC([],OutputDirectoryName,data,rawdata,data_info);
prior_posterior_statistics('gsa',data,data_info.gend,data_info.data_index,data_info.missing_value);
prior_posterior_statistics('gsa',dataset_);
if options_.bayesian_irf
PosteriorIRF('gsa');
end
......
function prior_posterior_statistics(type,Y,gend,data_index,missing_value)
function prior_posterior_statistics(type,dataset)
% function PosteriorFilterSmootherAndForecast(Y,gend, type)
% Computes posterior filter smoother and forecasts
......@@ -7,10 +7,7 @@ function prior_posterior_statistics(type,Y,gend,data_index,missing_value)
% type: posterior
% prior
% gsa
% Y: data
% gend: number of observations
% data_index [cell] 1*smpl cell of column vectors of indices.
% missing_value 1 if missing values, 0 otherwise
% dataset: data structure
%
% OUTPUTS
% none
......@@ -43,6 +40,12 @@ global options_ estim_params_ oo_ M_ bayestopt_
localVars=[];
Y = dataset.data;
gend = dataset.info.ntobs;
data_index = dataset.missing.aindex;
missing_value = dataset.missing.state;
bayestopt_.mean_varobs = dataset.descriptive.mean';
nvx = estim_params_.nvx;
nvn = estim_params_.nvn;
ncx = estim_params_.ncx;
......
......@@ -61,5 +61,5 @@ stderr e_ys,inv_gamma_pdf,1.2533,0.6551;
stderr e_pies,inv_gamma_pdf,1.88,0.9827;
end;
estimation(datafile=data_ca1,first_obs=8,nobs=[76 79],mh_nblocks=1,prefilter=1,mh_jscale=0.5,mh_replic=2000,forecast=8) y_obs R_obs pie_obs dq de;;
estimation(datafile=data_ca1,first_obs=8,nobs=[76 79],mh_nblocks=1,prefilter=1,mh_jscale=0.5,mh_replic=2000,forecast=8) y_obs R_obs pie_obs dq de;
Markdown is supported
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