From 6030fed4ec2a1c27f49f523d3f9defb97ac88e40 Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx,de>
Date: Thu, 14 Aug 2014 10:47:29 +0200
Subject: [PATCH] Fix bug in dynare_estimation_init.m with analytic_derivation
 where parameter vector was not set

Before testing whether the steady state file changes parameter values, the parameter values were not set, leading to subsequent crashes
---
 matlab/dynare_estimation_init.m | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/matlab/dynare_estimation_init.m b/matlab/dynare_estimation_init.m
index 1294f7b5fd..e0b823b416 100644
--- a/matlab/dynare_estimation_init.m
+++ b/matlab/dynare_estimation_init.m
@@ -435,7 +435,8 @@ if options_.analytic_derivation,
     if estim_params_.np,
         % check if steady state changes param values
         M=M_;
-        M.params(estim_params_.param_vals(:,1)) = M.params(estim_params_.param_vals(:,1))*1.01;
+        M.params(estim_params_.param_vals(:,1)) = xparam1(estim_params_.nvx+estim_params_.ncx+estim_params_.nvn+estim_params_.ncn+1:end); %set parameters
+        M.params(estim_params_.param_vals(:,1)) = M.params(estim_params_.param_vals(:,1))*1.01; %vary parameters
         if options_.diffuse_filter
             steadystate_check_flag = 0;
         else
-- 
GitLab