Differences between revisions 41 and 42
Revision 41 as of 2011-04-26 13:45:43
Size: 23252
Editor: JakeSmith
Comment:
Revision 42 as of 2011-04-29 13:31:12
Size: 17675
Editor: JakeSmith
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:

'''NB:''' The Previous Dynare Option Names specified below can be found on MarkovSwitchingOptions.

== Create Init File Mex Function ==
'''Create Init File Syntax''' (from {{{switch_dw/state_space/sbvar/create_init_file.c}}}):<<BR>><<BR>>
{{{create_init_file <matlab filename> <markov filename> <file tag>}}}
|| '''Standalone Argument (no flags)''' ||||'''Dynare Option and Argument''' |||| '''Previous Dynare Option Name''' |||| '''Comments''' ||
|| {{{<matlab filename>}}} || None. Set automatically in {{{sz_prd.m}}} || |||| |||| matlab file name ||
|| {{{<markov filename>}}} || {{{markov_file}}} || {{{<<string>>}}} |||| {{{markov_file}}} |||| Markov file name ||
|| {{{<file tag>}}} || {{{output_file_tag}}} || {{{<<string>>}}} |||| {{{output_file_tag}}} |||| The output file tag ||

== Estimation, Simulation, Probabilities, Marginal Data Densitiy, IRF, Forecast Mex Functions ==

'''Top Level Options''' (from {{{switch_dw/state_space/sbvar/dw_sbvar_command_line.c}}}):
|||| '''Standalone Flag and Argument''' |||| '''Standalone Default''' ||||'''Dynare Option and Argument''' |||| '''Previous Dynare Option Name''' |||| '''Comments''' ||
|| {{{estimate}}} || -- |||| -- || {{{estimate_msmodel}}} || |||| {{{estimate_msmodel}}} |||| produces estimation - posterior mode or maximum likelihood ||
|| {{{simulate}}} || -- |||| -- || {{{print_draws}}} || |||| {{{print_draws}}}|||| produces simulation run ||
|| {{{probabilities}}} || -- |||| -- || {{{compute_probabilities}}} || |||| {{{compute_probabilities}}} |||| produces smoothed or filtered probabilities ||
|| {{{mdd}}} || -- |||| -- || {{{compute_mdd}}} || |||| {{{compute_mdd}}} |||| produces marginal data density from posterior draws ||
|| {{{forecast}}} || -- |||| -- || {{{forecast}}} || {{{<<integer>>}}} |||| |||| produces mean forecast ||
|| {{{ir}}} || -- |||| -- || {{{irf}}} || {{{<<integer>>}}} |||| |||| produces impulse responses for a given set of parameters ||
|| {{{ir}}} || -- |||| -- || {{{bayesian_irf}}} || {{{<<integer>>}}} |||| |||| produces banded impulse responses ||
|| {{{historical}}} || -- |||| -- || || |||| |||| produces historical decomposition ||
|| {{{smoothedshocks}}} || -- |||| -- || || |||| |||| produces smoothed shocks ||
|| {{{smoothedstates}}} || -- |||| -- || || |||| |||| produces smoothed states ||
|| {{{seed}}} || {{{<<integer>>}}} |||| {{{0}}} (i.e. random) || set by {{{set_dynare_seed()}}} in .mod file || |||| |||| seed value for random number generation ||

<<BR>>
'''General Options''' (from {{{switch_dw/state_space/sbvar/dw_sbvar_command_line.c}}}):
|||| '''Standalone Flag and Argument''' |||| '''Standalone Default''' |||| '''Dynare Option and Argument''' |||| '''Previous Dynare Option Name''' |||| '''Standalone Flag set by other MS Dynare Option named''' ||||'''Comments''' ||
|| {{{di}}} || {{{<<string>>}}} |||| {{{./}}} || not supported || -- |||| |||| |||| input files are in specified directory ||
|| {{{do}}} || {{{<<string>>}}} |||| {{{./}}} || not supported || -- |||| |||| |||| output files are in specified directory ||
|| {{{fs}}} || {{{<<string>>}}} |||| || || |||| |||| |||| specification file name ||
|| {{{fp}}} || {{{<<string>>}}} |||| || || |||| |||| |||| parameter file name ||
|| {{{ph}}} || {{{<<string>>}}} |||| || || |||| |||| |||| header for the parameters ||
|| {{{pho}}} || {{{<<string>>}}} |||| || || |||| |||| |||| parameter header used for output ||
|| {{{MLE}}} || {{{<<string>>}}} |||| || || |||| |||| |||| Determines if estimation finds the posterior mode or maximum likelihood. If {{{ph}}} or is not present, determines whether the input parameter header is "MLE: " or "Posterior mode: ". ||
|| {{{fo}}} || {{{<<string>>}}} |||| || || |||| |||| |||| output file name ||
|| {{{ft}}} || {{{<<string>>}}} |||| || || |||| |||| |||| The input file tag. Is used to create input filenames if the {{{fs}}} or {{{fp}}} options are not present. ||
|| {{{fto}}} || {{{<<string>>}}} |||| associated with {{{ft}}} || {{{output_file_tag}}} || {{{<<string>>}}} |||| {{{output_file_tag}}} |||| |||| The output file tag. Used to create output filenames. ||

<<BR>>
'''Estimation Options''' (from {{{switch_dw/state_space/sbvar/sbvar_estimate.c}}}):
|||| '''Standalone Flag and Argument''' |||| '''Standalone Default''' |||| '''Dynare Option and Argument''' |||| '''Previous Dynare Option Name''' |||| '''Standalone Flag set by other MS Dynare Option named''' |||| '''Comments''' ||
|| {{{ft}}}* || {{{<<string>>}}} |||| |||| |||| |||| |||| The input file tag. Is used to create input filenames ||
|| {{{fs}}} || {{{<<string>>}}} |||| || {{{mode_file}}} || {{{<<string>>}}} |||| |||| |||| Model specification file to initialize the model with ||
|| {{{seed}}}* || {{{<<integer>>}}} |||| {{{0 (random)}}} |||| set by {{{set_dynare_seed()}}} in .mod file |||| |||| |||| Seed for random number generation initialization ||
|| {{{random}}} || {{{<<integer>>}}} |||| {{{5}}} || || |||| |||| |||| Number of random draws to make at each stage of the estimation process||
|| {{{random_max}}} || {{{<<integer>>}}} |||| {{{20}}} || || |||| |||| |||| Maximum number of random stages allowed ||
|| {{{random_tol_obj}}} || {{{<<double>>}}} |||| {{{0.1}}} || || |||| |||| |||| Convergence criterion for objective function ||
|| {{{random_tol_parms}}} || {{{<<double>>}}} |||| {{{0.1}}} || || |||| |||| |||| Convergence criterion for parameter values ||
|| {{{cb}}} || {{{<<double>>}}} |||| {{{1.0e-03}}} || || |||| |||| |||| convergence criterion starting value ||
|| {{{ce}}} || {{{<<double>>}}} |||| {{{1.0e-06}}} || || |||| |||| |||| convergence criterion ending value ||
|| {{{ci}}} || {{{<<double>>}}} |||| {{{0.1}}} || || |||| |||| |||| convergence criterion increment value ||
|| {{{ib}}} || {{{<<integer>>}}} |||| {{{50}}} || || |||| |||| |||| maximum interations starting value ||
|| {{{ii}}} || {{{<<double>>}}} |||| {{{2.0}}} || || |||| |||| |||| maximum interations increment value ||
|| {{{mb}}} || {{{<<integer>>}}} |||| {{{100}}} || || |||| |||| |||| maximum block iterations ||

<<BR>>
'''Simulation Options''' (from {{{switch_dw/state_space/sbvar/sbvar_simulate.c}}}):
|||| '''Standalone Flag and Argument''' |||| '''Standalone Default''' |||| '''Dynare Option and Argument''' |||| '''Previous Dynare Option Name''' |||| '''Standalone Flag set by other MS Dynare Option named''' |||| '''Comments''' ||
|| {{{ft}}}* || {{{<<string>>}}} |||| |||| |||| |||| |||| The input file tag. Is used to create input filenames ||
|| {{{seed}}}* || {{{<<integer>>}}} |||| {{{0 (random)}}} |||| set by {{{set_dynare_seed()}}} in .mod file |||| |||| |||| Seed for random number generation initialization ||
|| {{{ndraws}}}* || {{{<<integer>>}}} |||| {{{1000}}} || {{{mh_replic}}} || {{{<<integer>>}}} |||| {{{mh_replic}}} |||| |||| Number of draws to save ||
|| {{{burnin}}}* || {{{<<integer>>}}} |||| {{{0.1*ndraws}}} || {{{drop}}} || {{{<<integer>>}}} |||| {{{draws_nbr_burn_in_1}}} {{{draws_nbr_burn_in_2}}} |||| |||| The number of samples to drop at the beginning of the sampling period ||
|| {{{thin}}}* || {{{<<integer>>}}} |||| {{{1}}} || {{{thinning_factor}}} || {{{<<integer>>}}} |||| {{{thinning_factor}}} |||| |||| Thinning factor. Total number of draws made is {{{thin*ndraws+burnin}}} ||
|| {{{mh}}}* || {{{<<integer>>}}} |||| {{{30000}}} || {{{adaptive_mh_draws}}} || {{{<<integer>>}}} |||| |||| |||| Tuning period for Metropolis-Hasting draws ||
|| {{{flat}}} || -- |||| {{{off}}} || || |||| |||| |||| Produce flat output file and header ||
|| {{{nofree}}} || -- |||| {{{off}}} || || |||| |||| |||| Do not produce free parameters file ||
|| {{{nd1}}} || -- |||| {{{off}}} || || |||| |||| |||| Normalize diagonal of A0 to one (flat output only) ||

<<BR>>
'''Probabilities Options''' (from {{{switch_dw/state_space/sbvar/sbvar_probabilities.c}}}):
|||| '''Standalone Flag and Argument''' |||| '''Standalone Default''' |||| '''Dynare Option and Argument''' |||| '''Previous Dynare Option Name''' |||| '''Standalone Flag set by other MS Dynare Option named''' |||| '''Comments''' ||
|| {{{filtered}}} || -- |||| {{{on}}} || || |||| |||| |||| Compute filtered probabilities ||
|| {{{smoothed}}} || -- |||| {{{on}}} if neither {{{filtered}}} nor {{{real_time_smoothed}}} is passed || || |||| |||| |||| Compute smoothed probabilities ||
|| {{{real_time_smoothed}}}* || -- |||| {{{off}}} || || |||| |||| |||| Compute smoothed probabilities based on time {{{t}}} information for {{{0 <= t <= nobs}}} ||

<<BR>>
'''Marginal Data Density Options''' (from {{{switch_dw/switching/dw_mdd_switch.c}}}):
|||| '''Standalone Flag and Argument''' |||| '''Standalone Default''' |||| '''Dynare Option and Argument''' |||| '''Previous Dynare Option Name''' |||| '''Standalone Flag set by other MS Dynare Option named''' |||| '''Comments''' ||
|| {{{ft}}}* || {{{<<string>>}}} |||| || || |||| |||| |||| filemname tag -- supersedes {{{t}}} ||
|| {{{pf}}} || {{{<<string>>}}} |||| {{{simulation_<tag>.out}}} || || |||| |||| |||| posterior draws fileanme ||
|| {{{pt}}} || {{{<<integer>>}}} |||| {{{2}}} || mdd_proposal_type || {{{<<vector>>[type, lcut, hcut]}}} |||| |||| |||| proposal type ({{{1}}}=gaussian, {{{2}}}=power, {{{3}}}=truncated power, {{{4}}}=step, {{{5}}}=truncated gaussian), mdd_proposal_type=[type, lower_cutoff, high_cutoff] ||
|| {{{d}}}* || {{{<<integer>>}}} |||| {{{100,000}}} || mdd_proposal_draws || |||| |||| |||| number proposal draws||
|| {{{use_mode}}}|| -- |||| {{{on}}} || || |||| |||| |||| use posterior mode as center||
|| {{{use_mean}}}*|| -- |||| {{{off}}} || mdd_use_mean_center || |||| |||| |||| use posterior mean as center||
|| {{{of}}} || {{{<<string>>}}} |||| {{{mdd_<tag>.out}}} || || |||| |||| |||| output filename ||
|| {{{l}}}* || {{{<<double>>}}} |||| {{{0.1}}} || see proposal_type || |||| |||| |||| Lower cutoff for in terms of probability. Used by truncated power, truncated gaussian, step, and uniform. ||
|| {{{h}}}* || {{{<<double>>}}} |||| {{{0.9}}} || see proposal_type || |||| |||| |||| Upper cutoff for in terms of probability. Used by power, truncated power, truncated gaussian, step, and uniform. ||
|| {{{graph}}} || -- |||| {{{off}}} || || |||| |||| |||| Produce output suitable for graphing the marginal cummulative densities of the radius of the posterior and elliptical distributions. The marginal data density is not computed. ||
|| {{{print}}} || -- |||| {{{off}}} || || |||| |||| |||| Prints the matrices posterior and proposal ||


  
Line 124: Line 30:
|| {{{lower_cholesky}}} || {{{<<integer>>}}} |||| |||| 0 |||| lower_cholesky |||| lower_cholesky || || {{{lower_cholesky}}} || {{{<<integer>>}}} |||| |||| 0 |||| lower_cholesky |||| lower_cholesky ||
 
 
== Create Init File Mex Function ==
'''Create Init File Syntax''' (from {{{switch_dw/state_space/sbvar/create_init_file.c}}}):<<BR>><<BR>>
{{{create_init_file <matlab filename> <markov filename> <file tag>}}}
|| '''Standalone Argument (no flags)''' ||||'''Dynare Option and Argument''' |||| '''Previous Dynare Option Name''' |||| '''Comments''' ||
|| {{{<matlab filename>}}} || None. Set automatically in {{{sz_prd.m}}} || |||| |||| matlab file name ||
|| {{{<markov filename>}}} || {{{markov_file}}} || {{{<<string>>}}} |||| {{{markov_file}}} |||| Markov file name ||
|| {{{<file tag>}}} || {{{output_file_tag}}} || {{{<<string>>}}} |||| {{{output_file_tag}}} |||| The output file tag ||

== Estimation, Simulation, Probabilities, Marginal Data Densitiy, IRF, Forecast Mex Functions ==
 
<<BR>>
'''Estimation''' (from {{{switch_dw/state_space/sbvar/sbvar_estimate.c}}}):
|| Option || Value || Default || Dynare Option || Preproccessor Option || Comments ||
|| || || {{{1}}} || || mode_compute || ||
|| {{{fp}}} || {{{<<string>>}}} || || {{{options_.ms.mode_file}}} || mode_file || ||
|| {{{ft}}} || {{{<<string>>}}} || || {{{M_.fname}}} || || ||
|| {{{seed}}} || {{{<<integer>>}}} || {{{0}}} || {{{options_.DynareRandomStreams.seed}}} || || ||
|| {{{random}}} || {{{<<integer>>}}} || {{{5}}} || {{{options_.ms.estimate.random}}} || || ||
|| {{{random_max}}} || {{{<<integer>>}}} || {{{20}}} || {{{options_.ms.estimate.random_max}}} || || ||
|| {{{random_tol_obj}}} || {{{<<float>>}}} || {{{0.1}}} || {{{options_.ms.estimate.random_tol_obj}}} || || ||
|| {{{random_tol_parms}}} || {{{<<float>>}}} || {{{0.1}}} || {{{options_.ms.estimate.random_tol_parms}}} || || ||
|| {{{cb}}} || {{{<<float>>}}} || {{{1e-3}}} || {{{options_.ms.estimate.cb}}} || || ||
|| {{{ce}}} || {{{<<float>>}}} || {{{1e-6}}} || {{{options_.ms.estimate.ce}}} || || ||
|| {{{ci}}} || {{{<<float>>}}} || {{{0.1}}} || {{{options_.ms.estimate.ci}}} || || ||
|| {{{ib}}} || {{{<<integer>>}}} || {{{50}}} || {{{options_.ms.estimate.ib}}} || || ||
|| {{{ii}}} || {{{<<float>>}}} || {{{2.0}}} || {{{options_.ms.estimate.ii}}} || || ||
|| {{{mb}}} || {{{<<integer>>}}} || {{{100}}} || {{{options_.ms.estimate.mb}}} || || ||
Line 128: Line 63:
== MEX Functions General Options ==
|| '''Argument Name''' || '''Value Type''' || '''Default''' || '''Description''' || '''Files''' ||
|| {{{'free_parameters'}}} || {{{<vector>}}} || || Vector of free parameters to initialize the model with.|| 'mex_ms_forecast', 'mex_ms_variance_decomposition', 'mex_ms_irf' ||
|| {{{'horizon'}}} || {{{<<integer>}}} || {{{12}}} || If this argument exists, then the forecast horizon is given by the passed integer. || 'mex_ms_forecast', 'mex_ms_variance_decomposition', 'mex_ms_irf' ||
|| {{{'filtered'}}} || || {{{off}}} || Uses filtered probabilities at the end of the sample as initial conditions for regime probabilities. The default behavior is to us the erogdic distribution for the initial conditions. This flag only applies if neither 'regimes' nor 'regime' is specified. || 'mex_ms_forecast', 'mex_ms_variance_decomposition', 'mex_ms_irf' ||
|| {{{'error_bands'}}} || {{{<integer> 0 or 1}}}|| {{{1}}} || Output error bands. || 'mex_ms_forecast', 'mex_ms_variance_decomposition', 'mex_ms_irf' ||
|| {{{'percentiles'}}} || {{{<vector_value>>}}} || {{{[0.16 0.50 0.84]}}} || Percentiles to compute. The first parameter after percentiles must be the number of percentiles and the following values are the actual percentiles. default || 'mex_ms_forecast', 'mex_ms_variance_decomposition', 'mex_ms_irf' ||
|| {{{'parameter_uncertainty'}}} || {{{<integer> 0 or 1}}} || {{{0=off}}} || Apply parameter uncertainty when computing error bands or median. When set, will default shocks = 1, (Default = 0, off ) ||'mex_ms_forecast', 'mex_ms_variance_decomposition', 'mex_ms_irf' ||
|| {{{'shocks'}}} or {{{'shocks_per_parameter'}}} || {{{<integer>}}} || {{{1 if 'parameter_uncertainty', 10000 otherwise}}} || Number of regime paths to draw for each parameter draw. || 'mex_ms_forecast', 'mex_ms_variance_decomposition', 'mex_ms_irf' ||
|| {{{'thin'}}} || {{{<integer>}}} || {{{1}}}||Thinning factor. Only 1/thin of the draws in posterior draws file are used. || 'mex_ms_forecast', 'mex_ms_variance_decomposition', 'mex_ms_irf' ||
|| {{{'regimes'}}} || || {{{off=0}}}||Produces forecasts as if each regime were permanent. ||'mex_ms_forecast', 'mex_ms_variance_decomposition', 'mex_ms_irf' ||
|| {{{'regime'}}} || {{{<integer>}}} || || Produces forecasts/irf/vd as if regime were permanent. Regime numbers are zero based. (default = off) || 'mex_ms_forecast', 'mex_ms_variance_decomposition', 'mex_ms_irf' ||
|| {{{'simulation_file'}}} || {{{<string>}}} || ||Name of the file containing the model's simulated free values || 'mex_ms_forecast', 'mex_ms_variance_decomposition', 'mex_ms_irf' ||
|| {{{'number_observations'}}} || {{{<integer>}}} || {{{0}}}||If this argument exists, then the number of data points included in the output is given by the passed integer int the forecast/vd output. || 'mex_ms_forecast', 'mex_ms_variance_decomposition' ||
|| {{{'median'}}} || || {{{off}}} || Shortcut to setting 'percentiles',[.5] || 'mex_ms_forecast', 'mex_ms_variance_decomposition', 'mex_ms_irf' ||
|| {{{'mean'}}} || || {{{off}}} || Compute the mean || 'mex_ms_variance_decomposition' ||
|| {{{'seed'}}} || {{{<integer>}}} || {{{0 (random)}}} || Set the seed for the random number generator ||

      
<<BR>>
'''mex_ms_convert_free_parameters''' (from {{{mex/sources/ms-sbvar/mex_ms_convert_free_parameters}}}):
Converts a vector of free parameters for a given model to the posterior matrices, with Q being the grand transition matrix.
{{{
[A0,Aplus,Zeta,Q] = mex_ms_convert_free_parameters('file_tag', free_parameters) }}}

|| ||'''Parameters'''|| '''Type/Dimensions''' || '''Description''' ||
||<^|2> Inputs || {{{file_tag}}} || <string> || The file tag name used for a particular model ||
|| {{{free_parameters}}} || <vector> || Free Parameters from estimation or simulation of the particular model ||
||<-4>||
||<^|4> Output || {{{A0}}} || <matrix> (nregimes x nvar x nvar) || Contemporaneous Coefficient Matrix ||
|| {{{Aplus}}} || <matrix> (nregimes x (nvar x nlag + nconstant) x nvar) || Lagged Coefficient Matrix ||
|| {{{Zeta}}} || <matrix> (nregimes x nvar x nvar) || Shock Coefficient Matrix ||
|| {{{Q}}} || <matrix> (nregimes x nregimes) || Grand Transition Matrix ||
'''Simulation''' (from {{{switch_dw/state_space/sbvar/sbvar_simulate.c}}}):
|| Option || Value || Default || Dynare Option || Preproccessor Option || Comments ||
|| || {{{<<string>>}}} || 0 || {{{options_.ms.load_mh_file}}} || load_md_file || ||
|| {{{ft}}} || {{{<<string>>}}} || || {{{M_.fname}}} || || ||
|| {{{seed}}} || {{{<<integer>>}}} || {{{0}}} || {{{options_.DynareRandomStreams.seed}}}|| || ||
|| {{{ndraws}}} || {{{<<integer}}} || {{{1000}}} || {{{options_.ms.mh_replic}}} || mh_replic || ||
|| {{{burnin}}} || {{{<<integer>>}}} || {{{0.1*ndraws}}} || {{{options_.ms.drop}}} || || ||
|| {{{thin}}} || {{{<<integer>>}}} || {{{1}}} || {{{options_.ms.thinning_factor}}} || || ||
|| {{{mh}}} || {{{<<integer>>}}} || {{{30000}}} || {{{options_.ms.adapative_mh_draws}}} || || ||
Line 164: Line 75:
'''mex_ms_irf''' (from {{{mex/sources/ms-sbvar/mex_ms_irf.cc}}}):
Produce the impulse response for a given model and given options. The output matrix will be of dimensions [nregimes x num_percentiles x horizon x (nvar*nvar)]
{{{
[irf] = mex_ms_irf('file_tag', varargin)
}}}
|| ||'''Parameters'''|| '''Type/Dimensions''' || '''Description''' ||
||<^|2> Inputs || {{{file_tag}}} || <string> || The file tag name used for a particular model ||
|| {{{varargin}}} || || Any of the optional arguments ||
||<^|3>Output || {{{irf}}} || <matrix> (nregimes x npercentiles x horizon x (nvar x nvar)) || The Impulse responses for a given model ||
|| || matrix (npercentiles x horizon x (nvar x nvar)) || If 'regimes' was '''NOT''' Specified ||
|| || matrix (horizon x (nvar x nvar)) || If neither 'regimes' was specified and the median was only being reported ||

{{{
Example Usage:

[irf] = mex_ms_irf('file_tag', 'regimes','error_bands','horizon',20)
size(irf) = [nregimes x 3 x 20 x (nvar x nvar)]

[irf] = mex_ms_irf('file_tag', 'percentiles',[0.5],'horizon',20)
size(irf) = [20 x (nvar x nvar)]
}}}
'''Marginal Data Density''' (from {{{switch_dw/state_space/sbvar/sbvar_mdd.c}}}):
|| Option || Value || Default || Dynare Option || Preproccessor Option || Comments ||
|| || || {{{1}}} || {{{options_.ms.compute_mdd}}} || compute_mdd || ||
|| {{{ft}}} || {{{<<string>>}}} || || {{{M_.fname}}} || || ||
|| {{{seed}}} || {{{<<integer>>}}} || {{{0}}} || {{{options_.DynareRandomStreams.seed}}} || || ||
|| {{{d}}} || {{{<<integer>>}}} || {{{100000}}} || {{{options_.ms.mdd_proposal_draws}}} || || ||
|| {{{pt}}} || {{{<<integer>>}}} || {{{2}}} || {{{options_.ms.mdd_proposal_type(1)}}} || || ||
|| {{{l}}} || {{{<<float>>}}} || {{{0.1}}} || {{{options_.ms.mdd_proposal_type(2)}}} || || ||
|| {{{u}}} || {{{<<float>>}}} || {{{0.9}}} || {{{options_.ms.mdd_proposal_type(3)}}} || || ||
|| {{{use_mean}}} || {{{<<intger>>}}} || {{{0}}} || {{{options_.ms.mdd_use_mean_center}}} || || ||
Line 188: Line 88:
'''mex_ms_forecast''' (from {{{mex/sources/ms-sbvar/mex_ms_forecast.cc}}}):
Produce the Forecasts for a given model and given options. The output matrix will be of dimensions [nregimes x num_percentiles x horizon x nvar].
{{{
[forecast] = mex_ms_forecast('file_tag', varargin)
}}}
|| ||'''Parameters'''|| '''Type/Dimensions''' || '''Description''' ||
||<^|2> Inputs || {{{file_tag}}} || <string> || The file tag name used for a particular model ||
|| {{{varargin}}} || || Any of the optional arguments ||
||<^|3>Output || {{{forecast}}} || <matrix> (nregimes x npercentiles x horizon x nvar) || The forecast for a given model ||
|| || matrix (npercentiles x horizon x nvar) || If 'regimes' was '''NOT''' Specified ||
|| || matrix (horizon x nvar) || If neither 'regimes' was specified and the median was only being reported ||

{{{
Example Usage:

[forecast] = mex_ms_forecast('file_tag', 'regimes','error_bands','horizon',20)
size(forecast) = [nregimes x 3 x 20 x nvar]

[forecast] = mex_ms_forecast('file_tag', 'percentiles',[0.5],'horizon',20)
size(forecast) = [20 x nvar]
}}}
'''Regime Probability''' (from {{{switch_dw/state_space/sbvar/sbvar_probabilities.c}}}):
|| Option || Value || Default || Dynare Option || Preproccessor Option || Comments ||
|| || || {{{1}}} || {{{options_.ms.compute_probabilities}}} || compute_probabilities|| ||
|| {{{ft}}} || {{{<<string>>}}} || || {{{M_.fname}}} || || ||
|| {{{seed}}} || {{{<<integer>>}}} || {{{0}}} || {{{options_.DynareRandomStreams.seed}}} || || ||
|| {{{filtered}}} || {{{<<integer>>}}} || {{{1}}} || {{{options_.ms.filtered_probabilities}}} || || ||
|| {{{real_time_smoothed}}} || {{{<<integer>>}}} || {{{0}}} || {{{options_.ms.real_time_smoothed_probabilities}}} || || ||
Line 212: Line 98:
'''mex_ms_variance_decomposition''' (from {{{mex/sources/ms-sbvar/mex_ms_variance_decomposition.cc}}}):
Produce the variance decomposition for a given model and given options. The output matrix will be of dimensions [nregimes x num_percentiles x horizon x (nvar*nvar)]
{{{
[vd] = mex_ms_variance_decomposition('file_tag', varargin)
}}}
|| ||'''Parameters'''|| '''Type/Dimensions''' || '''Description''' ||
||<^|2> Inputs || {{{file_tag}}} || <string> || The file tag name used for a particular model ||
|| {{{varargin}}} || || Any of the optional arguments ||
||<^|3>Output || {{{vd}}} || <matrix> (nregimes x npercentiles x horizon x (nvar x nvar)) || The variance decomposition for a given model ||
|| || matrix (npercentiles x horizon x (nvar x nvar)) || If 'regimes' was '''NOT''' Specified ||
|| || matrix (horizon x (nvar x nvar)) || If neither 'regimes' was specified and the median was only being reported ||
'''Impulse Responses''' (from {{{mex/sources/ms-sbvar/mex_ms_irf.cc}}}):
|| Option || Value || Default || Dynare Option || Preproccessor Option || Comments ||
|| 1st Argument || {{{<<string>>}}} || || {{{M_.fname}}} || || {{{<<file_tag>>}}} ||
|| {{{seed}}} || {{{<<integer>>}}} || {{{0}}} || {{{options_.DynareRandomStreams.seed}}} || || ||
|| {{{free_parameters}}} || {{{<<vector>>}}} || || || || ||
|| {{{horizon}}} || {{{<<integer>>}}} || {{12}} || {{{options_.ms.irf}}} || irf || ||
|| {{{filtered}}} || {{{<<integer>>}}} || {{{0}}} || || || ||
|| {{{error_bands}}} || {{{<<integer>>}}} || {{{1}}} || || || ||
|| {{{percentiles}}} || {{{<<vector>>}}} || || || || ||
|| {{{parameter_uncertainty}}} || {{{<<integer>>}}} || || || || ||
|| {{{shocks}}} || {{{<<integer>>}}} || {{{10000 or 10}}} || {{{options_.ms.shocks_per_parameter}}} & {{{options_.ms.shock_draws}}} || || ||
|| {{{thin}}} || {{{<<integer>>}}} || {{{1}}} || || || ||
|| {{{regimes}}} || {{{<<integer>>}}} || {{{0}}} || || || ||
|| {{{simulation_file}}} || {{{<<string>>}}} || {{{simulation_<file_tag>.out}}} || {{{options_.ms.load_mh_file}}} or {{{simulation_<file_tag>.out}}} || || ||
|| {{{median}}} || {{{<<integer>>}}} || {{{0}}} || || || ||
Line 224: Line 114:
{{{
Example Usage:
Line 227: Line 115:
[vd] = mex_ms_variance_decomposition('file_tag', 'regimes','error_bands','horizon',20)
size(vd) = [nregimes x 3 x 20 x (nvar x nvar)]
<<BR>>
'''Forecast''' (from {{{mex/sources/ms-sbvar/mex_ms_forecast.cc}}}):
|| Option || Value || Default || Dynare Option || Preproccessor Option || Comments ||
|| 1st Argument || {{{<<string>>}}} || || {{{M_.fname}}} || || {{{<<file_tag>>}}} ||
|| {{{seed}}} || {{{<<integer>>}}} || {{{0}}} || {{{options_.DynareRandomStreams.seed}}} || || ||
|| {{{free_parameters}}} || {{{<<vector>>}}} || || || || ||
|| {{{horizon}}} || {{{<<integer>>}}} || {{12}} || {{{options_.ms.forecast}}} || forecast || ||
|| {{{filtered}}} || {{{<<integer>>}}} || {{{0}}} || || || ||
|| {{{error_bands}}} || {{{<<integer>>}}} || {{{1}}} || || || ||
|| {{{percentiles}}} || {{{<<vector>>}}} || || || || ||
|| {{{parameter_uncertainty}}} || {{{<<integer>>}}} || || || || ||
|| {{{shocks}}} || {{{<<integer>>}}} || {{{10000 or 10}}} || {{{options_.ms.shocks_per_parameter}}} & {{{options_.ms.shock_draws}}} || || ||
|| {{{thin}}} || {{{<<integer>>}}} || {{{1}}} || || || ||
|| {{{regimes}}} || {{{<<integer>>}}} || {{{0}}} || || || ||
|| {{{simulation_file}}} || {{{<<string>>}}} || {{{simulation_<file_tag>.out}}} || {{{options_.ms.load_mh_file}}} or {{{simulation_<file_tag>.out}}} || || ||
|| {{{median}}} || {{{<<integer>>}}} || {{{0}}} || || || ||
Line 230: Line 132:
[vd] = mex_ms_variance_decomposition('file_tag', 'percentiles',[0.5],'horizon',20)
size(vd) = [20 x (nvar x nvar)]
}}}

<<BR>>
'''Variance Decomposition''' (from {{{mex/sources/ms-sbvar/mex_ms_variance_decomposition.cc}}}):
|| Option || Value || Default || Dynare Option || Preproccessor Option || Comments ||
|| 1st Argument || {{{<<string>>}}} || || {{{M_.fname}}} || || {{{<<file_tag>>}}} ||
|| {{{seed}}} || {{{<<integer>>}}} || {{{0}}} || {{{options_.DynareRandomStreams.seed}}} || || ||
|| {{{free_parameters}}} || {{{<<vector>>}}} || || || || ||
|| {{{horizon}}} || {{{<<integer>>}}} || {{12}} || {{{options_.ms.variance_decomposition}}} || variance_decomposition|| ||
|| {{{filtered}}} || {{{<<integer>>}}} || {{{0}}} || || || ||
|| {{{error_bands}}} || {{{<<integer>>}}} || {{{0}}} || || || ||
|| {{{percentiles}}} || {{{<<vector>>}}} || || || || ||
|| {{{parameter_uncertainty}}} || {{{<<integer>>}}} || || || || ||
|| {{{shocks}}} || {{{<<integer>>}}} || {{{10000 or 10}}} || {{{options_.ms.shocks_per_parameter}}} & {{{options_.ms.shock_draws}}} || || ||
|| {{{thin}}} || {{{<<integer>>}}} || {{{1}}} || || || ||
|| {{{regimes}}} || {{{<<integer>>}}} || {{{0}}} || || || ||
|| {{{simulation_file}}} || {{{<<string>>}}} || {{{simulation_<file_tag>.out}}} || {{{options_.ms.load_mh_file}}} or {{{simulation_<file_tag>.out}}} || || ||
|| {{{median}}} || {{{<<integer>>}}} || {{{0}}} || || || ||
|| {{{mean}}} || {{{<<integer>>}}} || {{{1}}} || || || ||


Dynare Option and Argument

Comments

Default

Matlab Variable Name

Previous Dynare Option Name

create_initialization_file

<<integer>>

1. to create init_<output_file_tag>.dat 0. Otherwise

1

create_initialization_file

mode_compute

<<integer>>

1. Use csminwel to estimate the mode 0. Will not try to estimate the model

1

estimate_msmodel

mode_file

<<string>>

Mode file to load instead of re-estimating the model

coefficients_prior_hyperparameters

<<vec_value>>

Sets the hyper parameters for the sbvar (mu in sz_prd.m), this should be a vector of doubles of length 6

[1.0 1.0 0.1 1.2 1.0 1.0]

adaptive_mh_draws

<<integer>>

Number of draws for the Adaptive MH step

load_mh_file

<<string>>

Filename of previously computed simulation run, load this instead of simulating the model again.

freq

<<integer>>

quarters or months

4

q_m

freq

initial_year

<<integer>>

beginning of the year

yrBin

initial_year

initial_subperiod

<<integer>>

beginning of the quarter or month

1

qmBin

initial_subperiod

final_year

<<integer>>

final year

yrFin

final_year

final_subperiod

<<integer>>

final month or quarter

qmFin

final_subperiod

datafile

<<string>>

Load data

data_file

varlist

<<vec_value>>

Names of variables

varlist

varlist

restriction_fname

<<string>>

file for restriction on time variations

idfile_const

restriction_fname

nlags

<<integer>>

Number of lags

4

lags

nlags

cross_restrictions

<<integer>>

1: cross-A0-and-A+ restrictions
0: idfile_const is all we have

0

indxc0Pres

cross_restrictions

contemp_reduced_form

<<integer>>

1: contemporaneous recursive reduced form
0: restricted (non-recursive) form

0

Rform

comtemp_reduced_form

bayesian_prior

<<integer>>

1: Bayesian prior
0: no prior

1

indxPrior

bayesian_prior

alpha

<<double>>

Alpha value for squared time-varying structural shock lambda.

1.0

galp

alpha

beta

<<double>>

Beta value for squared time-varying structural shock lambda.

1.0

gbeta

beta

gsig2_lmd

<<integer>>

Case 4 (no state change across variables (i) and across lags (l); only one scale factor for all lagged variables change from state to state). Normal prior variance for structural shock lambda, one scale factor for all lagged D+ in a given equation.

502

gsig2_lmd

gsig2_lmd

gsig2_lmdm

<<integer>>

Case 3 (no state change across lags (l) but allows all variables for a given lag to switch states). Normal prior variance for different variables in lagged D+.

502

gsig2_lmdm

gsig2_lmdm

upper_cholesky

<<integer>>

0

upper_cholesky

upper_cholesky

|| lower_cholesky || <<integer>> |||| |||| 0 |||| lower_cholesky |||| lower_cholesky ||

Create Init File Mex Function

Create Init File Syntax (from switch_dw/state_space/sbvar/create_init_file.c):

create_init_file <matlab filename> <markov filename> <file tag>

Standalone Argument (no flags)

Dynare Option and Argument

Previous Dynare Option Name

Comments

<matlab filename>

None. Set automatically in sz_prd.m

matlab file name

<markov filename>

markov_file

<<string>>

markov_file

Markov file name

<file tag>

output_file_tag

<<string>>

output_file_tag

The output file tag

== Estimation, Simulation, Probabilities, Marginal Data Densitiy, IRF, Forecast Mex Functions ==


Estimation (from switch_dw/state_space/sbvar/sbvar_estimate.c):

Option

Value

Default

Dynare Option

Preproccessor Option

Comments

1

mode_compute

fp

<<string>>

options_.ms.mode_file

mode_file

ft

<<string>>

M_.fname

seed

<<integer>>

0

options_.DynareRandomStreams.seed

random

<<integer>>

5

options_.ms.estimate.random

random_max

<<integer>>

20

options_.ms.estimate.random_max

random_tol_obj

<<float>>

0.1

options_.ms.estimate.random_tol_obj

random_tol_parms

<<float>>

0.1

options_.ms.estimate.random_tol_parms

cb

<<float>>

1e-3

options_.ms.estimate.cb

ce

<<float>>

1e-6

options_.ms.estimate.ce

ci

<<float>>

0.1

options_.ms.estimate.ci

ib

<<integer>>

50

options_.ms.estimate.ib

ii

<<float>>

2.0

options_.ms.estimate.ii

mb

<<integer>>

100

options_.ms.estimate.mb


Simulation (from switch_dw/state_space/sbvar/sbvar_simulate.c):

Option

Value

Default

Dynare Option

Preproccessor Option

Comments

<<string>>

0

options_.ms.load_mh_file

load_md_file

ft

<<string>>

M_.fname

seed

<<integer>>

0

options_.DynareRandomStreams.seed

ndraws

<<integer

1000

options_.ms.mh_replic

mh_replic

burnin

<<integer>>

0.1*ndraws

options_.ms.drop

thin

<<integer>>

1

options_.ms.thinning_factor

mh

<<integer>>

30000

options_.ms.adapative_mh_draws


Marginal Data Density (from switch_dw/state_space/sbvar/sbvar_mdd.c):

Option

Value

Default

Dynare Option

Preproccessor Option

Comments

1

options_.ms.compute_mdd

compute_mdd

ft

<<string>>

M_.fname

seed

<<integer>>

0

options_.DynareRandomStreams.seed

d

<<integer>>

100000

options_.ms.mdd_proposal_draws

pt

<<integer>>

2

options_.ms.mdd_proposal_type(1)

l

<<float>>

0.1

options_.ms.mdd_proposal_type(2)

u

<<float>>

0.9

options_.ms.mdd_proposal_type(3)

use_mean

<<intger>>

0

options_.ms.mdd_use_mean_center


Regime Probability (from switch_dw/state_space/sbvar/sbvar_probabilities.c):

Option

Value

Default

Dynare Option

Preproccessor Option

Comments

1

options_.ms.compute_probabilities

compute_probabilities

ft

<<string>>

M_.fname

seed

<<integer>>

0

options_.DynareRandomStreams.seed

filtered

<<integer>>

1

options_.ms.filtered_probabilities

real_time_smoothed

<<integer>>

0

options_.ms.real_time_smoothed_probabilities


Impulse Responses (from mex/sources/ms-sbvar/mex_ms_irf.cc):

Option

Value

Default

Dynare Option

Preproccessor Option

Comments

1st Argument

<<string>>

M_.fname

<<file_tag>>

seed

<<integer>>

0

options_.DynareRandomStreams.seed

free_parameters

<<vector>>

horizon

<<integer>>

12

options_.ms.irf

irf

filtered

<<integer>>

0

error_bands

<<integer>>

1

percentiles

<<vector>>

parameter_uncertainty

<<integer>>

shocks

<<integer>>

10000 or 10

options_.ms.shocks_per_parameter & options_.ms.shock_draws

thin

<<integer>>

1

regimes

<<integer>>

0

simulation_file

<<string>>

simulation_<file_tag>.out

options_.ms.load_mh_file or simulation_<file_tag>.out

median

<<integer>>

0


Forecast (from mex/sources/ms-sbvar/mex_ms_forecast.cc):

Option

Value

Default

Dynare Option

Preproccessor Option

Comments

1st Argument

<<string>>

M_.fname

<<file_tag>>

seed

<<integer>>

0

options_.DynareRandomStreams.seed

free_parameters

<<vector>>

horizon

<<integer>>

12

options_.ms.forecast

forecast

filtered

<<integer>>

0

error_bands

<<integer>>

1

percentiles

<<vector>>

parameter_uncertainty

<<integer>>

shocks

<<integer>>

10000 or 10

options_.ms.shocks_per_parameter & options_.ms.shock_draws

thin

<<integer>>

1

regimes

<<integer>>

0

simulation_file

<<string>>

simulation_<file_tag>.out

options_.ms.load_mh_file or simulation_<file_tag>.out

median

<<integer>>

0


Variance Decomposition (from mex/sources/ms-sbvar/mex_ms_variance_decomposition.cc):

Option

Value

Default

Dynare Option

Preproccessor Option

Comments

1st Argument

<<string>>

M_.fname

<<file_tag>>

seed

<<integer>>

0

options_.DynareRandomStreams.seed

free_parameters

<<vector>>

horizon

<<integer>>

12

options_.ms.variance_decomposition

variance_decomposition

filtered

<<integer>>

0

error_bands

<<integer>>

0

percentiles

<<vector>>

parameter_uncertainty

<<integer>>

shocks

<<integer>>

10000 or 10

options_.ms.shocks_per_parameter & options_.ms.shock_draws

thin

<<integer>>

1

regimes

<<integer>>

0

simulation_file

<<string>>

simulation_<file_tag>.out

options_.ms.load_mh_file or simulation_<file_tag>.out

median

<<integer>>

0

mean

<<integer>>

1

DynareWiki: MSSbvarOptions (last edited 2012-03-08 14:53:45 by HoutanBastani)