Add option for selection of draw number to execute_prior_posterior_function.m
parent
02bd634046
commit
4c15342e98
|
@ -48,11 +48,13 @@ end
|
||||||
%Create function handle
|
%Create function handle
|
||||||
functionhandle=str2func(posterior_function_name);
|
functionhandle=str2func(posterior_function_name);
|
||||||
|
|
||||||
|
n_draws=options_.prior_posterior_sampling_draws;
|
||||||
% Get informations about the _posterior_draws files.
|
% Get informations about the _posterior_draws files.
|
||||||
if strcmpi(type,'posterior')
|
if strcmpi(type,'posterior')
|
||||||
%% discard first mh_drop percent of the draws:
|
%% discard first mh_drop percent of the draws:
|
||||||
CutSample(M_, options_, estim_params_);
|
CutSample(M_, options_, estim_params_);
|
||||||
%% initialize metropolis draws
|
%% 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_);
|
[error_flag,junk,options_]= metropolis_draw(1,options_,estim_params_,M_);
|
||||||
if error_flag
|
if error_flag
|
||||||
error('EXECUTE_POSTERIOR_FUNCTION: The draws could not be initialized')
|
error('EXECUTE_POSTERIOR_FUNCTION: The draws could not be initialized')
|
||||||
|
@ -60,7 +62,6 @@ if strcmpi(type,'posterior')
|
||||||
n_draws=options_.sub_draws;
|
n_draws=options_.sub_draws;
|
||||||
elseif strcmpi(type,'prior')
|
elseif strcmpi(type,'prior')
|
||||||
prior_draw(1);
|
prior_draw(1);
|
||||||
n_draws=options_.prior_draws;
|
|
||||||
else
|
else
|
||||||
error('EXECUTE_POSTERIOR_FUNCTION: Unknown type!')
|
error('EXECUTE_POSTERIOR_FUNCTION: Unknown type!')
|
||||||
end
|
end
|
||||||
|
|
|
@ -291,6 +291,9 @@ options_.xls_range = '';
|
||||||
% Prior draws
|
% Prior draws
|
||||||
options_.prior_draws = 10000;
|
options_.prior_draws = 10000;
|
||||||
|
|
||||||
|
% Prior posterior function sampling draws
|
||||||
|
options_.prior_posterior_sampling_draws = 500;
|
||||||
|
|
||||||
options_.forecast = 0;
|
options_.forecast = 0;
|
||||||
|
|
||||||
% Model
|
% Model
|
||||||
|
|
Loading…
Reference in New Issue