diff --git a/doc/dynare.texi b/doc/dynare.texi index a48c6a5ab..f55599867 100644 --- a/doc/dynare.texi +++ b/doc/dynare.texi @@ -6004,13 +6004,22 @@ Variable set by the @code{estimation} command, if it is used with @end defvr @defvr {MATLAB/Octave variable} oo_.posterior_mode -Variable set by the @code{estimation} command, if it is used with -@code{mh_replic > 0} or @code{load_mh_file} option. Fields are of the form: +Variable set by the @code{estimation} command during mode-finding. Fields are +of the form: @example @code{oo_.posterior_mode.@var{ESTIMATED_OBJECT}.@var{VARIABLE_NAME}} @end example @end defvr +@defvr {MATLAB/Octave variable} oo_.posterior_std_at_mode +Variable set by the @code{estimation} command during mode-finding. It is based on the +inverse Hessian at @code{oo_.posterior_mode}. Fields are +of the form: +@example +@code{oo_.posterior_std_at_mode.@var{ESTIMATED_OBJECT}.@var{VARIABLE_NAME}} +@end example +@end defvr + @defvr {MATLAB/Octave variable} oo_.posterior_std Variable set by the @code{estimation} command, if it is used with @code{mh_replic > 0} or @code{load_mh_file} option. Fields are of the form: @@ -6019,6 +6028,22 @@ Variable set by the @code{estimation} command, if it is used with @end example @end defvr +@defvr {MATLAB/Octave variable} oo_.posterior_var +Variable set by the @code{estimation} command, if it is used with +@code{mh_replic > 0} or @code{load_mh_file} option. Fields are of the form: +@example +@code{oo_.posterior_var.@var{ESTIMATED_OBJECT}.@var{VARIABLE_NAME}} +@end example +@end defvr + +@defvr {MATLAB/Octave variable} oo_.posterior_median +Variable set by the @code{estimation} command, if it is used with +@code{mh_replic > 0} or @code{load_mh_file} option. Fields are of the form: +@example +@code{oo_.posterior_median.@var{ESTIMATED_OBJECT}.@var{VARIABLE_NAME}} +@end example +@end defvr + Here are some examples of generated variables: @example diff --git a/matlab/GetPosteriorParametersStatistics.m b/matlab/GetPosteriorParametersStatistics.m index f674e071f..84e9ee1a9 100644 --- a/matlab/GetPosteriorParametersStatistics.m +++ b/matlab/GetPosteriorParametersStatistics.m @@ -382,6 +382,7 @@ eval(['oo.posterior_hpdinf.' type '.' name ' = hpdinterval(1);']); eval(['oo.posterior_hpdsup.' type '.' name ' = hpdinterval(2);']); eval(['oo.posterior_median.' type '.' name ' = postmedian;']); eval(['oo.posterior_variance.' type '.' name ' = postvar;']); +eval(['oo.posterior_std.' type '.' name ' = sqrt(postvar);']); eval(['oo.posterior_deciles.' type '.' name ' = postdecile;']); eval(['oo.posterior_density.' type '.' name ' = density;']); diff --git a/matlab/convert_dyn_45_to_44.m b/matlab/convert_dyn_45_to_44.m index 9d503bf4b..3de191c90 100644 --- a/matlab/convert_dyn_45_to_44.m +++ b/matlab/convert_dyn_45_to_44.m @@ -111,3 +111,9 @@ if isfield(oo_,'FilteredVariables') end end end + +%% set old field posterior_std and remove new field posterior_std_at_mode +if isfield(oo_,'posterior_std_at_mode') + oo_.posterior_std=oo_.posterior_std_at_mode; + oo_=rmfield(oo_,'posterior_std_at_mode'); +end diff --git a/matlab/display_estimation_results_table.m b/matlab/display_estimation_results_table.m index 334182bcb..d813d3f5a 100644 --- a/matlab/display_estimation_results_table.m +++ b/matlab/display_estimation_results_table.m @@ -73,7 +73,7 @@ if np header_width,name,xparam1(ip),stdh(ip),tstath(ip)); end eval(['oo_.' field_name '_mode.parameters.' name ' = xparam1(ip);']); - eval(['oo_.' field_name '_std.parameters.' name ' = stdh(ip);']); + eval(['oo_.' field_name '_std_at_mode.parameters.' name ' = stdh(ip);']); ip = ip+1; end skipline() @@ -95,7 +95,7 @@ if nvx end M_.Sigma_e(k,k) = xparam1(ip)*xparam1(ip); eval(['oo_.' field_name '_mode.shocks_std.' name ' = xparam1(ip);']); - eval(['oo_.' field_name '_std.shocks_std.' name ' = stdh(ip);']); + eval(['oo_.' field_name '_std_at_mode.shocks_std.' name ' = stdh(ip);']); ip = ip+1; end skipline() @@ -116,7 +116,7 @@ if nvx fprintf('%-*s %8.4f %7.4f %7.4f \n',header_width,name,xparam1(ip),stdh(ip),tstath(ip)) end eval(['oo_.' field_name '_mode.measurement_errors_std.' name ' = xparam1(ip);']); - eval(['oo_.' field_name '_std.measurement_errors_std.' name ' = stdh(ip);']); + eval(['oo_.' field_name '_std_at_mode.measurement_errors_std.' name ' = stdh(ip);']); ip = ip+1; end skipline() @@ -141,7 +141,7 @@ if ncx M_.Sigma_e(k1,k2) = xparam1(ip)*sqrt(M_.Sigma_e(k1,k1)*M_.Sigma_e(k2,k2)); M_.Sigma_e(k2,k1) = M_.Sigma_e(k1,k2); eval(['oo_.' field_name '_mode.shocks_corr.' NAME ' = xparam1(ip);']); - eval(['oo_.' field_name '_std.shocks_corr.' NAME ' = stdh(ip);']); + eval(['oo_.' field_name '_std_at_mode.shocks_corr.' NAME ' = stdh(ip);']); ip = ip+1; end skipline() @@ -164,7 +164,7 @@ if ncn fprintf('%-*s %8.4f %7.4f %7.4f \n',header_width,name,xparam1(ip),stdh(ip),tstath(ip)); end eval(['oo_.' field_name '_mode.measurement_errors_corr.' NAME ' = xparam1(ip);']); - eval(['oo_.' field_name '_std.measurement_errors_corr.' NAME ' = stdh(ip);']); + eval(['oo_.' field_name '_std_at_mode.measurement_errors_corr.' NAME ' = stdh(ip);']); ip = ip+1; end skipline()