From 90ab263587cde61a0b5e3e21cf48a20735a8aa2d Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Sun, 15 May 2016 14:18:03 +0200 Subject: [PATCH] Fix location of TaRB options --- matlab/posterior_sampler_core.m | 2 +- matlab/posterior_sampler_iteration.m | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/matlab/posterior_sampler_core.m b/matlab/posterior_sampler_core.m index 0c67aa749..5aa3f8398 100644 --- a/matlab/posterior_sampler_core.m +++ b/matlab/posterior_sampler_core.m @@ -99,7 +99,7 @@ if strcmpi(ProposalFun,'rand_multivariate_normal') sampler_options.n = npar; sampler_options.ProposalDensity = 'multivariate_normal_pdf'; elseif strcmpi(ProposalFun,'rand_multivariate_student') - sampler_options.n = options_.student_degrees_of_freedom; + sampler_options.n = sampler_options.student_degrees_of_freedom; sampler_options.ProposalDensity = 'multivariate_student_pdf'; end diff --git a/matlab/posterior_sampler_iteration.m b/matlab/posterior_sampler_iteration.m index 3b864b610..8ac0b4108 100644 --- a/matlab/posterior_sampler_iteration.m +++ b/matlab/posterior_sampler_iteration.m @@ -70,7 +70,7 @@ switch posterior_sampling_method %% randomize indices for blocking in this iteration global objective_function_penalty_base indices=randperm(npar)'; - blocks=[1; (1+cumsum((rand(length(indices)-1,1)>(1-options_.TaRB.new_block_probability))))]; + blocks=[1; (1+cumsum((rand(length(indices)-1,1)>(1-sampler_options.new_block_probability))))]; nblocks=blocks(end,1); %get number of blocks this iteration current_draw=last_draw'; %get starting point for current draw for updating blocked_draws_counter=0; @@ -79,7 +79,7 @@ switch posterior_sampling_method blocked_draws_counter=blocked_draws_counter+1; nxopt=length(indices(blocks==block_iter,1)); %get size of current block par_start_current_block=current_draw(indices(blocks==block_iter,1)); - [xopt_current_block, fval, exitflag, hess_mat_optimizer, options_, Scale] = dynare_minimize_objective(@TaRB_optimizer_wrapper,par_start_current_block,options_.TaRB.mode_compute,options_,[mh_bounds.lb(indices(blocks==block_iter,1),1) mh_bounds.ub(indices(blocks==block_iter,1),1)],bayestopt_.name,bayestopt_,[],... + [xopt_current_block, fval, exitflag, hess_mat_optimizer, options_, Scale] = dynare_minimize_objective(@TaRB_optimizer_wrapper,par_start_current_block,sampler_options.mode_compute,options_,[mh_bounds.lb(indices(blocks==block_iter,1),1) mh_bounds.ub(indices(blocks==block_iter,1),1)],bayestopt_.name,bayestopt_,[],... current_draw,indices(blocks==block_iter,1),TargetFun,...% inputs for wrapper varargin{:}); %inputs for objective objective_function_penalty_base=Inf; %reset penalty that may have been changed by optimizer