diff --git a/matlab/print_expectations.m b/matlab/print_expectations.m index 30dc3624f..b0ea4287a 100644 --- a/matlab/print_expectations.m +++ b/matlab/print_expectations.m @@ -281,7 +281,9 @@ if isequal(expectationmodelkind, 'pac-expectations') && growth_correction lgrowth = expectationmodel.growth_lag; otherwise end - vgrowth = rewritegrowthvariable(vgrowth, lgrowth, M_); + if ismember(expectationmodel.growth_type, {'endogenous','exogenous'}) + vgrowth = rewritegrowthvariable(vgrowth, lgrowth, M_); + end fprintf(fid, '%s*%s', pgrowth, vgrowth); fclose(fid); fprintf('Growth neutrality correction is saved in %s.\n', filename); @@ -400,7 +402,9 @@ for i=1:maxlag lgrowth = expectationmodel.growth_lag; otherwise end - vgrowth = rewritegrowthvariable(vgrowth, lgrowth, M_); + if ismember(expectationmodel.growth_type, {'endogenous','exogenous'}) + vgrowth = rewritegrowthvariable(vgrowth, lgrowth, M_); + end if parameter>=0 expression = sprintf('%s*%s+%s*%s', num2str(pgrowth, '%1.16f'), vgrowth, num2str(parameter, '%1.16f'), variable); else diff --git a/tests/pac/var-5/substitution.mod b/tests/pac/var-5/substitution.mod index 20ad29a56..41ae58da3 100644 --- a/tests/pac/var-5/substitution.mod +++ b/tests/pac/var-5/substitution.mod @@ -33,6 +33,8 @@ diff(x) = b_x_1*y(-2) + b_x_2*diff(x(-1)) + g*(1-b_x_2) + ex ; [name='eq:pac'] diff(z) = e_c_m*(x(-1)-z(-1)) + c_z_1*diff(z(-1)) + c_z_2*diff(z(-2)) + +@#include "example/model/pac-expectations/eq0-pacman-growth-neutrality-correction.inc" ++ @#include "example/model/pac-expectations/eq0-pacman-expression.inc" + ez;