From 2d17ff43a479f40c67c1d080e32887765134953f Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx.de>
Date: Tue, 20 Dec 2016 08:40:34 +0100
Subject: [PATCH] fs2000.mod unit test: move setting of Laplace marginal
 density to appropriate place

---
 tests/estimation/fs2000.mod | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/estimation/fs2000.mod b/tests/estimation/fs2000.mod
index a415eefa86..a70b76463c 100644
--- a/tests/estimation/fs2000.mod
+++ b/tests/estimation/fs2000.mod
@@ -105,9 +105,8 @@ copyfile([M_.dname filesep 'metropolis' filesep M_.dname '_mh1_blck1.mat'],[M_.d
 estimation(mode_compute=0,mode_file=fs2000_mode,order=1, datafile=fsdat_simul, nobs=192, loglinear, mh_replic=1500, mh_nblocks=1, mh_jscale=0.8);
 hh=eye(size(bayestopt_.name,1));
 save('fs2000_mode.mat','hh','-append')
-Laplace = oo_.MarginalDensity.LaplaceApproximation;
+Laplace = oo_.MarginalDensity.LaplaceApproximation; %save Laplace approximation which will be overwritten with set hh otherwise
 estimation(mode_compute=0,mode_file=fs2000_mode,order=1, datafile=fsdat_simul, nobs=192, loglinear, mh_replic=1500, mh_nblocks=1, mh_jscale=10,load_mh_file);
-oo_.MarginalDensity.LaplaceApproximation = Laplace;
 
 temp1=load([M_.dname '_mh1_blck1.mat']);
 temp2=load([M_.dname filesep 'metropolis' filesep M_.dname '_mh1_blck1.mat']);
@@ -117,4 +116,6 @@ if max(max(abs(temp1.x2-temp2.x2)))>1e-10
 end
 
 save('fs2000_result.mat','oo_')        
-estimation(mode_compute=0,mode_file=fs2000_mode,order=1, datafile=fsdat_simul, nobs=192, loglinear, mh_replic=0, mh_nblocks=1, mh_jscale=10,load_mh_file,load_results_after_load_mh,smoother) gy_obs gp_obs;
+options_.load_results_after_load_mh=1;
+estimation(mode_compute=0,mode_file=fs2000_mode,order=1, datafile=fsdat_simul, nobs=192, loglinear, mh_replic=0, mh_nblocks=1, mh_jscale=10,load_mh_file,smoother) gy_obs gp_obs;
+oo_.MarginalDensity.LaplaceApproximation = Laplace; %reset correct Laplace
-- 
GitLab