Skip to content
Snippets Groups Projects
Select Git revision
  • c1c65d8f3f4167cf7a293dbb48a3d48976caaf4d
  • master default protected
  • 6.x protected
  • madysson
  • 5.x protected
  • asm
  • time-varying-information-set
  • 4.6 protected
  • dynare_minreal
  • dragonfly
  • various_fixes
  • 4.5 protected
  • clang+openmp
  • exo_steady_state
  • declare_vars_in_model_block
  • julia
  • error_msg_undeclared_model_vars
  • static_aux_vars
  • slice
  • aux_func
  • penalty
  • 6.4 protected
  • 6.3 protected
  • 6.2 protected
  • 6.1 protected
  • 6.0 protected
  • 6-beta2 protected
  • 6-beta1 protected
  • 5.5 protected
  • 5.4 protected
  • 5.3 protected
  • 5.2 protected
  • 5.1 protected
  • 5.0 protected
  • 5.0-rc1 protected
  • 4.7-beta3 protected
  • 4.7-beta2 protected
  • 4.7-beta1 protected
  • 4.6.4 protected
  • 4.6.3 protected
  • 4.6.2 protected
41 results

configure.ac

Blame
  • check_posterior_sampler_options.m 20.84 KiB
    function [posterior_sampler_options, options_] = check_posterior_sampler_options(posterior_sampler_options, options_, bounds)
    
    % function [posterior_sampler_options, options_] = check_posterior_sampler_options(posterior_sampler_options, options_, bounds)
    % initialization of posterior samplers
    %
    % INPUTS
    %   posterior_sampler_options:       posterior sampler options
    %   options_:       structure storing the options
    
    % OUTPUTS
    %   posterior_sampler_options:       checked posterior sampler options
    %
    % SPECIAL REQUIREMENTS
    %   none
    
    % Copyright (C) 2015-2017 Dynare Team
    %
    % This file is part of Dynare.
    %
    % Dynare is free software: you can redistribute it and/or modify
    % it under the terms of the GNU General Public License as published by
    % the Free Software Foundation, either version 3 of the License, or
    % (at your option) any later version.
    %
    % Dynare is distributed in the hope that it will be useful,
    % but WITHOUT ANY WARRANTY; without even the implied warranty of
    % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    % GNU General Public License for more details.
    %
    % You should have received a copy of the GNU General Public License
    % along with Dynare.  If not, see <https://www.gnu.org/licenses/>.
    
    
    init=0;
    if isempty(posterior_sampler_options)
        init=1;
    end
    
    if init
        % set default options and user defined options
        posterior_sampler_options.posterior_sampling_method = options_.posterior_sampler_options.posterior_sampling_method;
        posterior_sampler_options.bounds = bounds;
    
        switch posterior_sampler_options.posterior_sampling_method
    
          case 'random_walk_metropolis_hastings'
            posterior_sampler_options.parallel_bar_refresh_rate=50;
            posterior_sampler_options.serial_bar_refresh_rate=3;
            posterior_sampler_options.parallel_bar_title='RWMH';
            posterior_sampler_options.serial_bar_title='RW Metropolis-Hastings';
    
            % default options
            posterior_sampler_options = add_fields_(posterior_sampler_options,options_.posterior_sampler_options.rwmh);
    
            % user defined options
            if ~isempty(options_.posterior_sampler_options.sampling_opt)
                options_list = read_key_value_string(options_.posterior_sampler_options.sampling_opt);
                for i=1:rows(options_list)
                    switch options_list{i,1}
    
                      case 'proposal_distribution'
                        if ~(strcmpi(options_list{i,2}, 'rand_multivariate_student') || ...
                             strcmpi(options_list{i,2}, 'rand_multivariate_normal'))
                            error(['initial_estimation_checks:: the proposal_distribution option to estimation takes either ' ...
                                   'rand_multivariate_student or rand_multivariate_normal as options']);
                        else
                            posterior_sampler_options.proposal_distribution=options_list{i,2};
                        end