| 1 |
function [ys_, params, info] = rbcii_steadystate(ys_, exo_, M_, options_) |
| 2 |
|
| 3 |
params = M_.params; |
| 4 |
|
| 5 |
% Flag initialization (equal to zero if the deterministic steady state exists) |
| 6 |
info = 0; |
| 7 |
|
| 8 |
% efficiency |
| 9 |
ys_(13)=0; |
| 10 |
|
| 11 |
% Efficiency |
| 12 |
ys_(12)=params(8); |
| 13 |
|
| 14 |
% Steady state ratios |
| 15 |
Output_per_unit_of_Capital=((1/params(1)-1+params(6))/params(4))^(1/(1-params(5))); |
| 16 |
Consumption_per_unit_of_Capital=Output_per_unit_of_Capital-params(6); |
| 17 |
Labour_per_unit_of_Capital=(((Output_per_unit_of_Capital/ys_(12))^params(5)-params(4))/(1-params(4)))^(1/params(5)); |
| 18 |
Output_per_unit_of_Labour=Output_per_unit_of_Capital/Labour_per_unit_of_Capital; |
| 19 |
Consumption_per_unit_of_Labour=Consumption_per_unit_of_Capital/Labour_per_unit_of_Capital; |
| 20 |
|
| 21 |
% Steady state share of capital revenues in total revenues (calibration check) |
| 22 |
ShareOfCapital=params(4)/(params(4)+(1-params(4))*Labour_per_unit_of_Capital^params(5)); |
| 23 |
|
| 24 |
% Steady state level of labour |
| 25 |
ys_(3)=1/(1+Consumption_per_unit_of_Labour/((1-params(4))*params(2)/(1-params(2))*Output_per_unit_of_Labour^(1-params(5)))); |
| 26 |
|
| 27 |
% Steady state level of consumption |
| 28 |
ys_(4)=Consumption_per_unit_of_Labour*ys_(3); |
| 29 |
|
| 30 |
% Steady state level of physical capital stock |
| 31 |
ys_(1)=ys_(3)/Labour_per_unit_of_Capital; |
| 32 |
|
| 33 |
% Steady state level of output |
| 34 |
ys_(2)=Output_per_unit_of_Capital*ys_(1); |
| 35 |
|
| 36 |
% Steady state level of investment |
| 37 |
ys_(5)=params(6)*ys_(1); |
| 38 |
|
| 39 |
% Steady state level of the expected term appearing in the Euler equation |
| 40 |
ys_(14)=(ys_(4)^params(2)*(1-ys_(3))^(1-params(2)))^(1-params(3))/ys_(4)*(1+params(4)*(ys_(2)/ys_(1))^(1-params(5))-params(6)); |
| 41 |
|
| 42 |
% Steady state level of output in the unconstrained regime (positive investment) |
| 43 |
ys_(6)=ys_(2); |
| 44 |
|
| 45 |
% Steady state level of labour in the unconstrained regime |
| 46 |
ys_(7)=ys_(3); |
| 47 |
|
| 48 |
% Steady state level of consumption in the unconstrained regime |
| 49 |
ys_(8)=ys_(4); |
| 50 |
|
| 51 |
% Steady state level of labour in the constrained regime (noinvestment) |
| 52 |
[lss,info] = l_solver(ys_(3),params(4),params(5),params(2),params(8),ys_(1),100); |
| 53 |
if info, return, end |
| 54 |
ys_(10) = lss; |
| 55 |
|
| 56 |
% Steady state level of consumption in the constrained regime |
| 57 |
ys_(11)=params(8)*(params(4)*ys_(1)^params(5)+(1-params(4))*ys_(10)^params(5))^(1/params(5)); |
| 58 |
|
| 59 |
% Steady state level of output in the constrained regime |
| 60 |
ys_(9)=ys_(11); |
| 61 |
|
| 62 |
end |
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
function r = p0(labour,alpha,psi,theta,effstar,kstar) |
| 68 |
r = labour * ( alpha*kstar^psi/labour^psi + 1-alpha + theta*(1-alpha)/(1-theta)/effstar^psi ) - theta*(1-alpha)/(1-theta)/effstar^psi; |
| 69 |
end |
| 70 |
|
| 71 |
function d = p1(labour,alpha,psi,theta,effstar,kstar) |
| 72 |
d = alpha*(1-psi)*kstar^psi/labour^psi + 1-alpha + theta*(1-alpha)/(1-alpha)/effstar^psi; |
| 73 |
end |
| 74 |
|
| 75 |
function [labour,info] = l_solver(labour,alpha,psi,theta,effstar,kstar,maxiter) |
| 76 |
iteration = 1; info = 0; |
| 77 |
r = p0(labour,alpha,psi,theta,effstar,kstar); |
| 78 |
condition = abs(r); |
| 79 |
while condition |
| 80 |
if iteration==maxiter |
| 81 |
info = 1; |
| 82 |
break |
| 83 |
end |
| 84 |
d = p1(labour,alpha,psi,theta,effstar,kstar); |
| 85 |
labour = labour - r/d; |
| 86 |
r = p0(labour,alpha,psi,theta,effstar,kstar); |
| 87 |
condition = abs(r)>1e-9; |
| 88 |
iteration = iteration + 1; |
| 89 |
end |
| 90 |
end |