Improve documentation for model_comparison.m

time-shift
Johannes Pfeifer 2015-08-06 10:36:45 +02:00
parent 35bd2ed5d0
commit a072294cab
2 changed files with 46 additions and 4 deletions

View File

@ -5814,12 +5814,14 @@ Standard deviation of structural shocks
@defvr {MATLAB/Octave variable} oo_.MarginalDensity.LaplaceApproximation
Variable set by the @code{estimation} command.
Variable set by the @code{estimation} command. Stores the marginal data density
based on the Laplace Approximation.
@end defvr
@defvr {MATLAB/Octave variable} oo_.MarginalDensity.ModifiedHarmonicMean
Variable set by the @code{estimation} command, if it is used with
@code{mh_replic > 0} or @code{load_mh_file} option.
@code{mh_replic > 0} or @code{load_mh_file} option. Stores the marginal data density
based on @cite{Geweke (1999)} Modified Harmonic Mean estimator.
@end defvr
@defvr {MATLAB/Octave variable} oo_.FilteredVariables
@ -6154,6 +6156,20 @@ Dynare: it is the user's responsibility to make sure that model comparison is
based on proper priors. Note that, for obvious reasons, this is not an issue if
the compared marginal densities are based on Laplace approximations.
@optionshead
@table @code
@item marginal_density = @var{ESTIMATOR}
Specifies the estimator for computing the marginal data density. @var{ESTIMATOR} can
take one of the following two values:
@code{laplace} for the Laplace estimator or @code{modifiedharmonicmean} for the
@cite{Geweke (1999)} Modified Harmonic Mean estimator. Default value: @code{laplace}
@end table
@outputhead
The results are stored in @code{oo_.Model_Comparison}, which is described below.
@examplehead
@ -6165,6 +6181,32 @@ over @code{alt_model}.
@end deffn
@defvr {MATLAB/Octave variable} oo_.Model_Comparison
Variable set by the @code{model_comparison} command. Fields are of the form:
@example
@code{oo_.Model_Comparison.@var{FILENAME}.@var{VARIABLE_NAME}}
@end example
where @var{FILENAME} is the file name of the model and @var{VARIABLE_NAME} is one of the following:
@table @code
@item Prior
(Normalized) prior density over the model
@item Log_Marginal_Density
Logarithm of the marginal data density
@item Bayes_Ratio
Ratio of the marginal data density of the model relative to the one of the first declared model
@item Posterior_Model_Probability
Posterior probability of the respective model
@end table
@end defvr
@deffn Command shock_decomposition [@var{VARIABLE_NAME}]@dots{};
@deffnx Command shock_decomposition (@var{OPTIONS}@dots{}) [@var{VARIABLE_NAME}]@dots{};

View File

@ -116,14 +116,14 @@ headers = char('Model',ShortModelNames{:});
if prior_flag
labels = char('Priors','Log Marginal Density','Bayes Ratio', ...
'Posterior Model Probability');
field_labels={'Priors','Log_Marginal_Density','Bayes_Ratio', ...
field_labels={'Prior','Log_Marginal_Density','Bayes_Ratio', ...
'Posterior_Model_Probability'};
values = [ModelPriors';MarginalLogDensity';exp(lmpd-lmpd(1))'; ...
elmpd'/sum(elmpd)];
else
labels = char('Priors','Log Marginal Density','Bayes Ratio','Posterior Odds Ratio', ...
'Posterior Model Probability');
field_labels={'Priors','Log_Marginal_Density','Bayes_Ratio','Posterior_Odds_Ratio','Posterior_Model_Probability'};
field_labels={'Prior','Log_Marginal_Density','Bayes_Ratio','Posterior_Odds_Ratio','Posterior_Model_Probability'};
values = [ModelPriors';MarginalLogDensity'; exp(MarginalLogDensity-MarginalLogDensity(1))'; ...
exp(lmpd-lmpd(1))'; elmpd'/sum(elmpd)];
end