Skip to content
Snippets Groups Projects
Select Git revision
  • fbf62255c631d62a5bd0f47a2ef471589ecb0d8b
  • master default
  • nlf-fixes
  • newton-quadratic-equation-solver
  • nlf-fixes-r
  • nls-fixes
  • sep-fixes
  • sep
  • use-dprior
  • ep-sparse
  • rebase-1
  • parfor
  • reset-seed-in-unit-tests
  • remove-persistent-variables
  • nonlinear-filter-fixes
  • pac-mce-with-composite-target
  • 6.x
  • dprior
  • covariance-quadratic-approximation
  • benchmark-ec
  • kalman_mex
  • 5.5
  • 5.4
  • 5.3
  • 5.2
  • 5.1
  • 5.0
  • 5.0-rc1
  • 4.7-beta3
  • 4.7-beta2
  • 4.7-beta1
  • 4.6.4
  • 4.6.3
  • 4.6.2
  • 4.6.1
  • 4.6.0
  • 4.6.0-rc2
  • 4.6.0-rc1
  • 4.6-beta1
  • 4.5.7
  • 4.5.6
41 results

set_default_options.m

Blame
  • Forked from Dynare / dynare
    Source project has a limited visibility.
    set_default_options.m 11.03 KiB
    function options_occbin_ = set_default_options(options_occbin_,M_,flag)
    % function options_occbin_ = set_default_options(options_occbin_,M_,flag)
    % Sets default options for Occbin
    %
    % INPUTS
    % - options_occbin_ [structure]     Matlab's structure describing the current options
    % - M_              [structure]     Matlab's structure describing the model
    % - flag            [cell]          govern what/how much to initialize
    %
    % OUTPUTS
    % - options_occbin_ [structure]     Matlab's structure describing the current options
    
    % Copyright © 2021 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/>.
    
    if nargin<3
        flag='all';
    end
    
    if ismember(flag,{'all'})
        options_occbin_.solver.solve_algo=3; %solver for match_function: csolve
        options_occbin_.solver.solve_tolx=1e-10;
        options_occbin_.solver.solve_tolf=1e-5;
        options_occbin_.solver.maxit=10;
        options_occbin_.write_regimes.periods=[];
        options_occbin_.write_regimes.type='simul';
        options_occbin_.write_regimes.filename=[M_.fname '_occbin_regimes'];
    end
    
    if ismember(flag,{'filter','all'})
        options_occbin_.filter.state_covariance = false;
        options_occbin_.filter.guess_regime = false;
        options_occbin_.filter.periodic_solution = true;
        options_occbin_.filter.use_relaxation = false;
    end
    
    if ismember(flag,{'forecast','all'})
        options_occbin_.forecast.check_ahead_periods=30;
        options_occbin_.forecast.debug_flag=false;
        options_occbin_.forecast.frcst_regimes=[];
        options_occbin_.forecast.maxit=30;
        options_occbin_.forecast.qmc=0;
        options_occbin_.forecast.replic=0;
        options_occbin_.forecast.sepath=0;    
        options_occbin_.forecast.SHOCKS0=[];
        options_occbin_.forecast.treepath=1; % number of branches
    end
    
    if ismember(flag,{'irf','all'})    
        options_occbin_.irf.check_ahead_periods=30;
        options_occbin_.irf.exo_names=M_.exo_names;
        options_occbin_.irf.init_regime=[];
        options_occbin_.irf.maxit=30;
    %     options_occbin_.irf.periods=options_.irf;
        options_occbin_.irf.shocksize=[];
        options_occbin_.irf.shocksigns = {'pos','neg'};