Differences between revisions 44 and 45
Revision 44 as of 2011-04-29 14:17:32
Size: 17540
Editor: JakeSmith
Comment:
Revision 45 as of 2011-05-05 09:23:01
Size: 19497
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
== Miscellaneous Commands needed by Matlab to link to the Mex Functions (below) == = Miscellaneous Commands needed by Matlab to link to the Mex Functions (below) =
Line 7: Line 7:
|| {{{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_compute}}} || {{{<<integer>>}}} ||||~- '''1.''' Use csminwel to estimate the model '''0.''' Will not try to estimate the model -~|||| 1 |||| ||||   ||
Line 32: Line 31:
== Mex Functions == = Mex Functions =
== General Options ==
Line 34: Line 34:
'''Top Level Options''' (from {{{switch_dw/state_space/sbvar/dw_sbvar_command_line.c}}}):

|| '''Option''' || '''Value''' || '''Default''' || '''Dynare Option''' || '''Preproccessor Option''' || '''Comments''' ||
|| {{{estimate}}} || -- || -- || {{{options_.ms.estimate_msmodel}}} || {{{estimate_msmodel}}} || produces estimation - posterior mode or maximum likelihood ||
|| {{{simulate}}} || -- || -- || {{{options_.ms.print_draws}}} || {{{print_draws}}} || produces simulation run ||
|| {{{mdd}}} || -- || -- || {{{options_.ms.compute_mdd}}} || {{{compute_mdd}}} || produces marginal data density from posterior draws ||
|| {{{probabilities}}} || -- || -- || {{{options_.ms.compute_probabilities}}} || {{{compute_probabilities}}} || produces smoothed or filtered probabilities ||
|| {{{forecast}}} || -- || -- || {{{options_.ms.forecast}}} || {{{forecast}}} || produces mean forecast ||
|| {{{ir}}} || -- || -- || {{{options_.ms.irf}}} || {{{irf}}} || produces impulse responses for a given set of parameters ||
|| {{{ir}}} || -- || -- || {{{options_.ms.bayesian_irf}}} || {{{bayesian_irf}}} || produces banded impulse responses ||
|| {{{variance_decomposition}}} || -- || -- || {{{options_.ms.variance_decomposition}}} || {{{variance_decomposition}}} || produce variance decomposition ||
|| {{{historical}}} || -- || -- || -- || -- || produces historical decomposition (not yet implemented) ||
|| {{{seed}}} || {{{<<integer>>}}} || {{{0}}} (i.e. random) || set by {{{set_dynare_seed()}}} in .mod file || || seed value for random number generation ||

<<BR>>

'''Options Accepted by All Mex Functions''' (from {{{switch_dw/state_space/sbvar/dw_sbvar_command_line.c}}}):

|| '''Option''' || '''Value''' || '''Default''' || '''Dynare Option''' || '''Preproccessor Option''' || '''Comments''' ||
|| {{{ft}}} || {{{<<string>>}}} || -- || {{{M_.fname}}} || set automatically using modfile name || The input file tag. Is used to create input file names if the {{{fs}}} or {{{fp}}} options are not present ||
|| {{{di}}} || {{{<<string>>}}} || {{{./}}} || not supported || -- || input files are in specified directory ||
|| {{{do}}} || {{{<<string>>}}} || {{{./}}} || not supported || -- || output files are in specified directory ||
|| {{{fs}}} || {{{<<string>>}}} || || not supported || -- || specification file name ||
|| {{{fp}}} || {{{<<string>>}}} || || not supported || -- || parameter file name ||
|| {{{ph}}} || {{{<<string>>}}} || || not supported || -- || header for the parameters ||
|| {{{MLE}}} || {{{<<string>>}}} || || not supported || -- || 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: ". ||
|| {{{fto}}} || {{{<<string>>}}} || || not supported || -- || The output file tag. Used to create output filenames. ||
|| {{{fo}}} || {{{<<string>>}}} || || not supported || -- || output file name ||
|| {{{pho}}} || {{{<<string>>}}} || || not supported || -- || parameter header used for output ||

== Mex Functions and Their Options ==
 
Line 44: Line 76:
|| 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}}} || || ||
|| '''Option''' || '''Value''' || '''Default''' || '''Dynare Option''' || '''Preproccessor Option''' || '''Comments''' ||
|| {{{fp}}} || {{{<<string>>}}} || || {{{options_.ms.mode_file}}} || {{{mode_file}}} || ||
Line 63: Line 92:
|| Option || Value || Default || Dynare Option || Preproccessor Option || Comments ||
|| || {{{<<string>>}}} || 0 || {{{options_.ms.load_mh_file}}} || load_mh_file || ||
|| {{{ft}}} || {{{<<string>>}}} || || {{{M_.fname}}} || || ||
|| {{{seed}}} || {{{<<integer>>}}} || {{{0}}} || {{{options_.DynareRandomStreams.seed}}}|| || ||
|| {{{ndraws}}} || {{{<<integer}}} || {{{1000}}} || {{{options_.ms.mh_replic}}} || mh_replic || ||
|| '''Option''' || '''Value''' || '''Default''' || '''Dynare Option''' || '''Preproccessor Option''' || '''Comments''' ||
|| {{{ndraws}}} || {{{<<integer}}} || {{{1000}}} || {{{options_.ms.mh_replic}}} || {{{mh_replic}}} || ||
Line 75: Line 101:
|| 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}}} || || ||
|| '''Option''' || '''Value''' || '''Default''' || '''Dynare Option''' || '''Preproccessor Option''' || '''Comments''' ||
Line 88: Line 111:
|| 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}}} || || ||
|| '''Option''' || '''Value''' || '''Default''' || '''Dynare Option''' || '''Preproccessor Option''' || '''Comments''' ||
Line 98: Line 118:
|| Option || Value || Default || Dynare Option || Preproccessor Option || Comments ||
|| 1st Argument || {{{<<string>>}}} || || {{{M_.fname}}} || || {{{<<file_tag>>}}} ||
|| {{{seed}}} || {{{<<integer>>}}} || {{{0}}} || {{{options_.DynareRandomStreams.seed}}} || || ||
|| '''Option''' || '''Value''' || '''Default''' || '''Dynare Option''' || '''Preproccessor Option''' || '''Comments''' ||
|| 1st Argument || {{{<<string>>}}} || || {{{M_.fname}}} || -- || see general options ||
Line 102: Line 121:
|| {{{horizon}}} || {{{<<integer>>}}} || {{12}} || {{{options_.ms.irf}}} || irf || || || {{{horizon}}} || {{{<<integer>>}}} || {{12}} || {{{options_.ms.irf}}} || passed by {{{irf=<<int>>}}} || ||
Line 116: Line 135:
|| Option                       || Value                || Default            || Dynare Option                                || Preproccessor Option || Comments ||
|| 1st Argument || {{{<<string>>}}} || || {{{M_.fname}}} || ||  {{{<<file_tag>>}}} ||
|| {{{seed}}} || {{{<<integer>>}}} || {{{0}}} || {{{options_.DynareRando
mStreams.seed}}} || || ||
|| {{{free_param
eters}}} || {{{<<vector>>}}} || || || || ||
|| {{{horizon}}} || {{{<<integer>>}}} || {{12}} || {{{options_.ms.forecast}}} || forecast || ||
|| '''Option''' || '''Value''' || '''Default''' || '''Dynare Option''' || '''Preproccessor Option''' || '''Comments''' ||
|| 1st Argument || {{{<<string>>}}} || || {{{M_.fname}}} || || see general options ||
|| {{{
free_parameters}}} || {{{<<vector>>}}} || || || -- || ||
|| {{{horizon}}} || {{{<<integer>>}}} || {{12}} || {{{options_.ms.forecast}}} || passed by {{{forecast=<<int>>}}} || ||
Line 134: Line 152:
|| Option || Value || Default || Dynare Option || Preproccessor Option || Comments ||
|| 1st Argument || {{{<<string>>}}} || || {{{M_.fname}}} || || {{{<<file_tag>>}}} ||
|| {{{seed}}} || {{{<<integer>>}}} || {{{0}}} || {{{options_.DynareRandomStreams.seed}}} || || ||
|| '''Option''' || '''Value''' || '''Default''' || '''Dynare Option''' || '''Preproccessor Option''' || '''Comments''' ||
|| 1st Argument || {{{<<string>>}}} || || {{{M_.fname}}} || -- || see general options ||
Line 138: Line 155:
|| {{{horizon}}} || {{{<<integer>>}}} || {{12}} || {{{options_.ms.variance_decomposition}}} || variance_decomposition|| || || {{{horizon}}} || {{{<<integer>>}}} || {{12}} || {{{options_.ms.variance_decomposition}}} || passed by {{{variance_decomposition=<<int>>}}} || ||


Miscellaneous Commands needed by Matlab to link to the Mex Functions (below)

Dynare Option and Argument

Comments

Default

Matlab Variable Name

Previous Dynare Option Name

mode_compute

<<integer>>

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

1

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

Mex Functions

General Options

Top Level Options (from switch_dw/state_space/sbvar/dw_sbvar_command_line.c):

Option

Value

Default

Dynare Option

Preproccessor Option

Comments

estimate

--

--

options_.ms.estimate_msmodel

estimate_msmodel

produces estimation - posterior mode or maximum likelihood

simulate

--

--

options_.ms.print_draws

print_draws

produces simulation run

mdd

--

--

options_.ms.compute_mdd

compute_mdd

produces marginal data density from posterior draws

probabilities

--

--

options_.ms.compute_probabilities

compute_probabilities

produces smoothed or filtered probabilities

forecast

--

--

options_.ms.forecast

forecast

produces mean forecast

ir

--

--

options_.ms.irf

irf

produces impulse responses for a given set of parameters

ir

--

--

options_.ms.bayesian_irf

bayesian_irf

produces banded impulse responses

variance_decomposition

--

--

options_.ms.variance_decomposition

variance_decomposition

produce variance decomposition

historical

--

--

--

--

produces historical decomposition (not yet implemented)

seed

<<integer>>

0 (i.e. random)

set by set_dynare_seed() in .mod file

seed value for random number generation


Options Accepted by All Mex Functions (from switch_dw/state_space/sbvar/dw_sbvar_command_line.c):

Option

Value

Default

Dynare Option

Preproccessor Option

Comments

ft

<<string>>

--

M_.fname

set automatically using modfile name

The input file tag. Is used to create input file names if the fs or fp options are not present

di

<<string>>

./

not supported

--

input files are in specified directory

do

<<string>>

./

not supported

--

output files are in specified directory

fs

<<string>>

not supported

--

specification file name

fp

<<string>>

not supported

--

parameter file name

ph

<<string>>

not supported

--

header for the parameters

MLE

<<string>>

not supported

--

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: ".

fto

<<string>>

not supported

--

The output file tag. Used to create output filenames.

fo

<<string>>

not supported

--

output file name

pho

<<string>>

not supported

--

parameter header used for output

Mex Functions and Their Options

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 (from switch_dw/state_space/sbvar/sbvar_estimate.c):

Option

Value

Default

Dynare Option

Preproccessor Option

Comments

fp

<<string>>

options_.ms.mode_file

mode_file

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

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

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

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

--

see general options

free_parameters

<<vector>>

horizon

<<integer>>

12

options_.ms.irf

passed by irf=<<int>>

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

see general options

free_parameters

<<vector>>

--

horizon

<<integer>>

12

options_.ms.forecast

passed by forecast=<<int>>

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

--

see general options

free_parameters

<<vector>>

horizon

<<integer>>

12

options_.ms.variance_decomposition

passed by variance_decomposition=<<int>>

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)