Skip to content
Snippets Groups Projects
Verified Commit 4ca5c366 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Fix cherrypick for PAC equations in case of rule of thumb agents.

The correction for growth neutrality should be substituted in the optimal part
of the PAC equations.

(cherry picked from commit 12694ff9347b2191b4e0f6a32cb038956cb38f53)
(cherry picked from commit 9acac86b)
parent 96242a0a
Branches
Tags
No related merge requests found
Pipeline #6166 passed
......@@ -134,10 +134,22 @@ for i=1:length(eqtags)
end
if ~isempty(ispac)
[rhs, growthneutralitycorrection] = write_expectations(eqtags{i}, ispac.name, 'pac');
lhs = sprintf('%s_PE', eqtags{i});
RHS = strrep(RHS, sprintf('pac_expectation(model_name = %s)', ispac.name), lhs);
if ~isempty(growthneutralitycorrection)
RHS = sprintf('%s + %s', RHS, growthneutralitycorrection);
if ~isempty(rhs)
lhs = sprintf('%s_PE', eqtags{i});
if isempty(growthneutralitycorrection)
RHS = strrep(RHS, sprintf('pac_expectation(model_name = %s)', ispac.name), lhs);
else
RHS = strrep(RHS, sprintf('pac_expectation(model_name = %s)', ispac.name), sprintf('%s+%s', lhs, growthneutralitycorrection));
end
else
% MCE version of the PAC equation.
[rhs, growthneutralitycorrection] = write_pac_mce_expectations(eqtags{i}, ispac.name);
lhs = sprintf('%s_Z', eqtags{i});
if isempty(growthneutralitycorrection)
RHS = strrep(RHS, sprintf('pac_expectation(model_name = %s)', ispac.name), lhs);
else
RHS = strrep(RHS, sprintf('pac_expectation(model_name = %s)', ispac.name), sprintf('%s+%s', lhs, growthneutralitycorrection));
end
end
end
% Print equation for unrolled PAC/VAR-expectation and update
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment