diff --git a/matlab/k_order_pert.m b/matlab/k_order_pert.m index 1622fc2f3..c6a9d38b0 100644 --- a/matlab/k_order_pert.m +++ b/matlab/k_order_pert.m @@ -27,6 +27,10 @@ endo_nbr = M.endo_nbr; exo_nbr = M.exo_nbr; nspred = M.nspred; +if order>1 && options.loglinear + error('The loglinear-option currently only works at order 1') +end + switch(order) case 1 [err, g_1] = k_order_perturbation(dr,M,options); diff --git a/matlab/stochastic_solvers.m b/matlab/stochastic_solvers.m index 3c6efeedb..c420bc99c 100644 --- a/matlab/stochastic_solvers.m +++ b/matlab/stochastic_solvers.m @@ -271,5 +271,8 @@ if options_.loglinear == 1 dr.ghx = repmat(1./dr.ys(k1),1,size(dr.ghx,2)).*dr.ghx.* ... repmat(dr.ys(k1(klag(:,1)))',size(dr.ghx,1),1); dr.ghu = repmat(1./dr.ys(k1),1,size(dr.ghu,2)).*dr.ghu; + if options_.order>1 + error('Loglinear options currently only works at order 1') + end end