estimation — computes estimation
estimation [(OPTION [, OPTION...])] [VARIABLE_NAME...] ;
datafile = FILENAMEThe datafile (a .m file, a .mat file or a .xls file)
xls_sheet = NAMEThe name of the sheet with the data in an Excel file
xls_range = RANGEThe range with the data in an Excel file
nobs = INTEGERThe number of observations to be used. Default: all observations in the file
nobs = [INTEGER_1:INTEGER_2]Runs a recursive estimation and forecast for samples of size ranging of INTEGER_1 to INTEGER_2. Option forecast must also be specified
first_obs = INTEGERThe number of the first observation to be used. Default: 1
prefilter = INTEGERA value of 1 means that the estimation procedure will demean the data. Default: 0, i.e. no prefiltering
presample = INTEGERThe number of observations to be skipped before evaluating the likelihood. Default: 0
loglinearComputes a log--linear approximation of the model instead of a linear approximation. The data must correspond to the definition of the variables used in the model. Default: computes a linear approximation
nographNo graphs should be plotted
lik_init = INTEGERType of initialization of Kalman filter:
1: for stationary models, the initial matrix of variance of the error of forecast is set equal to the unconditional variance of the state variables
2: for nonstationary models: a wide prior is used with an initial matrix of variance of the error of forecast diagonal with 10 on the diagonal
Default value is 1.
lik_algo = INTEGER...
conf_sig = DOUBLESee there
mh_replic = INTEGERNumber of replications for Metropolis-Hastings algorithm. For the time being, mh_replic should be larger than 1200. Default: 20000
mh_nblocks = INTEGERNumber of parallel chains for Metropolis-Hastings algorithm. Default: 2
mh_drop = DOUBLEThe fraction of initially generated parameter vectors to be dropped before using posterior simulations. Default: 0.5
mh_jscale = DOUBLEThe scale to be used for the jumping distribution in Metropolis-Hastings algorithm. The default value is rarely satisfactory. This option must be tuned to obtain, ideally, an acceptation rate of 25% in the Metropolis-Hastings algorithm. Default: 0.2
mh_init_scale = DOUBLEThe scale to be used for drawing the initial value of the Metropolis-Hastings chain. Default: 2*mh_scale
mh_recoverAttempts to recover a Metropolis-Hastings simulation that crashed prematurely. Shouldn't be used together with load_mh_file
mh_mode = INTEGER...
mode_file = FILENAMEName of the file containing previous value for the mode. When computing the mode, Dynare stores the mode (xparam1) and the hessian (hh) in a file called MODEL_FILENAME_mode.mat
mode_compute = INTEGER | FUNCTION_NAMESpecifies the optimizer for the mode computation:
0: the mode isn't computed. mode_file option must be specified
1: uses MATLAB®'s fmincon
2: value no longer used
3: uses MATLAB®'s fminunc
4: uses Chris Sims's csminwel
5: uses Marco Ratto's newrat
6: uses a Monte-Carlo based optimization routine (see Dynare wiki for more details)
7: uses MATLAB®'s fminsearch (a simplex based routine)
It is also possible to give a FUNCTION_NAME to this option, instead of an INTEGER. In that case, Dynare takes the return value of that function as the posterior mode.
Default value is 4.
mode_checkTells Dynare to plot the posterior density for values around the computed mode for each estimated parameter in turn. This is helpful to diagnose problems with the optimizer
prior_trunc = DOUBLEProbability of extreme values of the prior density that is ignored when computing bounds for the parameters. Default: 1e-32
load_mh_fileTells Dynare to add to previous Metropolis-Hastings simulations instead of starting from scratch. Shouldn't be used together with mh_recover
optim = (fmincon options)Can be used to set options for fmincon, the optimizing function of MATLAB® Optimizaiton toolbox. Use MATLAB®'s syntax for these options. Default: ('display','iter','LargeScale','off','MaxFunEvals',100000,'TolFun',1e-8,'TolX',1e-6)
nodiagnosticDoesn't compute the convergence diagnostics for Metropolis-Hastings. Default: diagnostics are computed and displayed
bayesian_irfTriggers the computation of the posterior distribution of IRFs. The length of the IRFs are controlled by the irf option
moments_varendoTriggers the computation of the posterior distribution of the theoretical moments of the endogenous variables
filtered_varsTriggers the computation of the posterior distribution of filtered endogenous variables and shocks
smootherTriggers the computation of the posterior distribution of smoothered endogenous variables and shocks
forecast = INTEGERComputes the posterior distribution of a forecast on INTEGER periods after the end of the sample used in estimation
texRequests the printing of results and graphs in TeX tables and graphics that can be later directly included in LaTeX files (not yet implemented)
kalman_algo = INTEGER...
kalman_tol = INTEGER...
filter_step_ahead = [INTEGER_1:INTEGER_2]...
constant...
noconstant...
diffuse_filter...
solve_algo = INTEGERSee there
order = INTEGERSee there
irf = INTEGERSee there
aim_solverSee there
If no mh_jscale parameter is used in estimated_params, the procedure uses mh_jscale for all parameters. If mh_jscale option isn't set, the procedure uses 0.2 for all parameters.
results from posterior optimization (also for maximum likelihood)
marginal log density
mean and shortest confidence interval from posterior simulation
Metropolis-Hastings convergence graphs that still need to be documented
graphs with prior, posterior and mode
graphs of smoothed shocks, smoothed observation errors, smoothed and historical variables
After running estimation, the parameters and the variance matrix of the shocks are set to the mode for maximum likelihood estimation or posterior mode computation without Metropolis iterations.
After estimation with Metropolis iterations (option mh_replic > 0 or option load_mh_file set) the parameters and the variance matrix of the shocks are set to the posterior mean.
Depending on the options, estimation stores results in the following fields of structure oo_:
Table 4.1. Content of oo_
| Field 1 | Field 2 | Field 3 | Field 4 | Field 5 | Required options |
|---|---|---|---|---|---|
Forecast | See Moments of forecasts | Variable name | forecast | ||
MarginalDensity | LaplaceApproximation | Always provided | |||
ModifiedHarmonicMean | mh_replic> 0 or load_mh_file | ||||
PosteriorFilteredVariables | See Moments Names | Variable name | |||
PosteriorIRF | Dsge | See Moments Names | IRF name: name of endogenous variable '_' name of shock | bayesian_irf | |
PosteriorSmoothedObservationErrors | See Moments Names | Variable name | |||
PosteriorSmoothedShocks | See Moments Names | Variable name | |||
PosteriorSmoothedVariables | See Moments Names | Variable name | |||
PosteriorTheoreticalMoments | See Theoretical Moments | See Estimated Objects | See Moments Names | Variable name | moments_varendo |
posterior_density | Parameter name | mh_replic> 0 or load_mh_file | |||
posterior_hpdinf | See Estimated Objects | Variable name | mh_replic> 0 or load_mh_file | ||
posterior_hpdsup | See Estimated Objects | Variable name | mh_replic> 0 or load_mh_file | ||
posterior_mean | See Estimated Objects | Variable name | mh_replic> 0 or load_mh_file | ||
posterior_mode | See Estimated Objects | Variable name | mh_replic> 0 or load_mh_file | ||
posterior_std | See Estimated Objects | Variable name | mh_replic> 0 or load_mh_file |
Table 4.2. Moments of forecasts
| Field name | Description |
|---|---|
HPDinf | Lower bound of a 90% HPD interval[a] of forecast due to parameter uncertainty |
HPDsup | Lower bound of a 90% HPD interval [a] due to parameter uncertainty |
HPDTotalinf | Lower bound of a 90% HPD interval of forecast [a] due to parameter uncertainty and future shocks |
HPDTotalsup | Lower bound of a 90% HPD interval [a] due to parameter uncertainty and future shocks |
Mean | Mean of the posterior distribution of forecasts |
Median | Median of the posterior distribution of forecasts |
Std | Standard deviation of the posterior distribution of forecasts |
Table 4.3. Moments Names
Table 4.4. Theoretical Moments
Table 4.5. Estimated objects
| Field name | Description |
|---|---|
measurement_errors_corr | Correlation between two measurement errors |
measurement_errors_std | Standard deviation of measurement errors |
parameters | Parameters |
shocks_corr | Correlation between two structural shocks |
shocks_std | Standard deviation of structural shocks |
If you know how to compute the steady state for your model, you can provide a MATLAB® function doing the computation instead of using steady. The function should be called with the name of the .mod file followed by _steadystate. See fs2000a_steadystate.m in examples/fs2000 directory.