From 7f15295cda5093e3d29ef8178bf81acf51e1dbb4 Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx,de>
Date: Wed, 2 Jul 2014 15:20:07 +0200
Subject: [PATCH] Add saving of parameter names to make loading of mh_mode-file
 compatible with mode_file option

---
 matlab/compute_mh_covariance_matrix.m | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/matlab/compute_mh_covariance_matrix.m b/matlab/compute_mh_covariance_matrix.m
index 05b0a42620..8b62a2afe2 100644
--- a/matlab/compute_mh_covariance_matrix.m
+++ b/matlab/compute_mh_covariance_matrix.m
@@ -32,7 +32,7 @@ function [posterior_mean,posterior_covariance,posterior_mode,posterior_kernel_at
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
-global M_ options_ estim_params_
+global M_ options_ estim_params_ bayestopt_
 
 
 n = estim_params_.np + ...
@@ -76,5 +76,6 @@ end
 xparam1 = posterior_mode';
 hh = inv(posterior_covariance);
 fval = posterior_kernel_at_the_mode;
+parameter_names = bayestopt_.name;
 
-save([M_.fname '_mh_mode.mat'],'xparam1','hh','fval');
\ No newline at end of file
+save([M_.fname '_mh_mode.mat'],'xparam1','hh','fval','parameter_names');
\ No newline at end of file
-- 
GitLab