9. Dynare misc commands¶
Executes a user-defined function on parameter draws from the prior distribution. Dynare returns the results of the computations for all draws in an $ndraws$ by $n$ cell array named
function = FUNCTION_NAME¶
The function must have the following header
output_cell = FILENAME(xparam1,M_,options_,oo_,estim_params_,bayestopt_,dataset_,dataset_info), providing read-only access to all Dynare structures. The only output argument allowed is a \(1 \times n\) cell array, which allows for storing any type of output/computations. This option is required.
sampling_draws = INTEGER¶
Number of draws used for sampling. Default: 500.
Same as the
prior_functioncommand but for the posterior distribution. Results returned in
function = FUNCTION_NAME
sampling_draws = INTEGER
Generates trace plots of the MCMC draws for all estimated parameters and the posterior density in the specified Markov Chain
Depending on the value of
internalscommand can be used to run unitary tests specific to a MATLAB/Octave routine (if available), to display documentation about a MATLAB/Octave routine, or to extract some informations about the state of Dynare.
Performs the unitary test associated to ROUTINENAME (if this routine exists and if the matlab/octave
.mfile has unitary test sections).
>> internals --test ROUTINENAME
routine.mis not in the current directory, the full path has to be given:
>> internals --test ../matlab/fr/ROUTINENAME
Prints on screen the internal documentation of ROUTINENAME (if this routine exists and if this routine has a texinfo internal documentation header). The path to
ROUTINENAMEhas to be provided, if the routine is not in the current directory.
>> internals --doc ../matlab/fr/ROUTINENAME
At this time, will work properly for only a small number of routines. At the top of the (available) MATLAB/Octave routines a commented block for the internal documentation is written in the GNU texinfo documentation format. This block is processed by calling texinfo from MATLAB. Consequently, texinfo has to be installed on your machine.
Displays information about the previously saved MCMC draws generated by a
.modfile named MODFILENAME. This file must be in the current directory.
>> internals --display-mh-history MODFILENAME
Loads into the MATLAB/Octave’s workspace informations about the previously saved MCMC draws generated by a
.modfile named MODFILENAME.
>> internals --load-mh-history MODFILENAME
This will create a structure called
mcmc_informations(in the workspace) with the following fields:
The number of MCMC chains.
nis the number of estimated parameters, array of doubles. Initial state of the MCMC.
nis the number of estimated parameters, array of doubles. Current state of the MCMC.
Nblck*1array of doubles. Initial value of the posterior kernel.
Nblck*1array of doubles. Current value of the posterior kernel.
1*Nblckstructure array. Initial state of the random number generator.
1*Nblckstructure array. Current state of the random number generator.
1*Nblckarray of doubles. Current acceptance ratios.
Prints information about the prior distribution given the provided options. If no options are provided, the command returns the list of available options.
Prints a table describing the marginal prior distributions (mean, mode, std., lower and upper bounds, HPD interval).
Computes and displays first and second order moments of the endogenous variables at the prior mode (considering the linearized version of the model).
Computes and displays the prior mean and prior standard deviation of the first and second moments of the endogenous variables (considering the linearized version of the model) by randomly sampling from the prior. The results will also be stored in the
priorsubfolder in a
Optimizes the prior density (starting from a random initial guess). The parameters such that the steady state does not exist or does not satisfy the Blanchard and Kahn conditions are penalized, as they would be when maximizing the posterior density. If a significant proportion of the prior mass is defined over such regions, the optimization algorithm may fail to converge to the true solution (the prior mode).
Computes the effective prior mass using a Monte-Carlo. Ideally the effective prior mass should be equal to 1, otherwise problems may arise when maximising the posterior density and model comparison based on marginal densities may be unfair. When comparing models, say \(A\) and \(B\), the marginal densities, \(m_A\) and \(m_B\), should be corrected for the estimated effective prior mass \(p_A\neq p_B \leq 1\) so that the prior mass of the compared models are identical.
Plots the marginal prior density.