From 0f1dd850ed3fdd705d00fd1fc2e81eeabc15a91d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Mon, 23 Jan 2012 13:59:25 +0100 Subject: [PATCH] Added one variable (LM) and one equation to ensure that the Lagrange multiplier is positive. It appeared that the Lagrange multiplier simulated by EP is positive, but the series simulated by SEP are most of the time negative. --- tests/ep/rbcii.mod | 9 ++++++--- tests/ep/rbcii_steadystate.m | 9 ++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/ep/rbcii.mod b/tests/ep/rbcii.mod index f72f83e0a..8e7a62c0e 100644 --- a/tests/ep/rbcii.mod +++ b/tests/ep/rbcii.mod @@ -1,6 +1,6 @@ -@#define extended_path_version = 1 +@#define extended_path_version = 0 -var Capital, Output, Labour, Consumption, Efficiency, efficiency, ExpectedTerm, LagrangeMultiplier; +var Capital, Output, Labour, Consumption, Efficiency, efficiency, ExpectedTerm, LM, LagrangeMultiplier; varexo EfficiencyInnovation; @@ -50,8 +50,11 @@ model(block,bytecode,cutoff=0); // Eq. n°7: (Capital==(1-delta)*Capital(-1))*(Output-Consumption) + (1-(Capital==(1-delta)*Capital(-1)))*LagrangeMultiplier = 0; - + // Eq. n°8: + (LM<0)*(LM+LagrangeMultiplier) + (1-(LM<0))*(LM-LagrangeMultiplier) = 0; + + // Eq. n°9: ExpectedTerm = beta*(((((Consumption^theta)*((1-Labour)^(1-theta)))^(1-tau))/Consumption)*(alpha*((Output/Capital(-1))^(1-psi))+(1-delta))-(1-delta)*LagrangeMultiplier); end; diff --git a/tests/ep/rbcii_steadystate.m b/tests/ep/rbcii_steadystate.m index 2a8f3aeec..ba7970eef 100644 --- a/tests/ep/rbcii_steadystate.m +++ b/tests/ep/rbcii_steadystate.m @@ -38,12 +38,11 @@ SteadyStateCapital=SteadyStateLabour/Labour_per_unit_of_Capital; SteadyStateOutput=Output_per_unit_of_Capital*SteadyStateCapital; % Fill returned argument ys with steady state values. -ys(2)=SteadyStateOutput; -ys(4)=SteadyStateConsumption; +ys = zeros(9,1); ys(1)=SteadyStateCapital; +ys(2)=SteadyStateOutput; ys(3)=SteadyStateLabour; +ys(4)=SteadyStateConsumption; ys(5)=M_.params(8); -ys(6)=0; ys(7)=M_.params(1)*((((SteadyStateConsumption^M_.params(2))*((1-SteadyStateLabour)^(1-M_.params(2))))^(1-M_.params(3)))/SteadyStateConsumption)* ... - (M_.params(4)*((SteadyStateOutput/SteadyStateCapital)^(1-M_.params(5)))+1-M_.params(6)); -ys(8)=0; \ No newline at end of file + (M_.params(4)*((SteadyStateOutput/SteadyStateCapital)^(1-M_.params(5)))+1-M_.params(6)); \ No newline at end of file