Add option for selection of draw number to execute_prior_posterior_function.m

time-shift
Johannes Pfeifer 2015-04-04 20:37:52 +02:00
parent 02bd634046
commit 4c15342e98
2 changed files with 5 additions and 1 deletions

View File

@ -48,11 +48,13 @@ end
%Create function handle
functionhandle=str2func(posterior_function_name);
n_draws=options_.prior_posterior_sampling_draws;
% Get informations about the _posterior_draws files.
if strcmpi(type,'posterior')
%% discard first mh_drop percent of the draws:
CutSample(M_, options_, estim_params_);
%% initialize metropolis draws
options_.sub_draws=n_draws; %set draws for sampling; changed value is not returned to base workspace
[error_flag,junk,options_]= metropolis_draw(1,options_,estim_params_,M_);
if error_flag
error('EXECUTE_POSTERIOR_FUNCTION: The draws could not be initialized')
@ -60,7 +62,6 @@ if strcmpi(type,'posterior')
n_draws=options_.sub_draws;
elseif strcmpi(type,'prior')
prior_draw(1);
n_draws=options_.prior_draws;
else
error('EXECUTE_POSTERIOR_FUNCTION: Unknown type!')
end

View File

@ -291,6 +291,9 @@ options_.xls_range = '';
% Prior draws
options_.prior_draws = 10000;
% Prior posterior function sampling draws
options_.prior_posterior_sampling_draws = 500;
options_.forecast = 0;
% Model