| 1 |
// Test extended_path + bytecode (regression check for #1742) |
| 2 |
|
| 3 |
var Capital, Output, Labour, Consumption, Efficiency, efficiency, ExpectedTerm; |
| 4 |
|
| 5 |
varexo EfficiencyInnovation; |
| 6 |
|
| 7 |
parameters beta, theta, tau, alpha, psi, delta, rho, effstar, sigma2; |
| 8 |
|
| 9 |
/* |
| 10 |
** Calibration |
| 11 |
*/ |
| 12 |
|
| 13 |
beta = 0.990; |
| 14 |
theta = 0.357; |
| 15 |
tau = 30.000; |
| 16 |
alpha = 0.450; |
| 17 |
psi = -5.000; |
| 18 |
delta = 0.020; |
| 19 |
rho = 0.950; |
| 20 |
effstar = 1.000; |
| 21 |
sigma2 = 0.0001; |
| 22 |
|
| 23 |
model(bytecode); |
| 24 |
|
| 25 |
// Eq. n°1: |
| 26 |
efficiency = rho*efficiency(-1) + EfficiencyInnovation; |
| 27 |
|
| 28 |
// Eq. n°2: |
| 29 |
Efficiency = effstar*exp(efficiency); |
| 30 |
|
| 31 |
// Eq. n°3: |
| 32 |
Output = Efficiency*(alpha*(Capital(-1)^psi)+(1-alpha)*(Labour^psi))^(1/psi); |
| 33 |
|
| 34 |
// Eq. n°4: |
| 35 |
Consumption + Capital - Output - (1-delta)*Capital(-1); |
| 36 |
|
| 37 |
// Eq. n°5: |
| 38 |
((1-theta)/theta)*(Consumption/(1-Labour)) - (1-alpha)*(Output/Labour)^(1-psi); |
| 39 |
|
| 40 |
// Eq. n°6: |
| 41 |
(Consumption^theta)*((1-Labour)^(1-theta)) - Consumption^(1/(1-tau))*ExpectedTerm(1); |
| 42 |
|
| 43 |
// Eq. n°7: |
| 44 |
ExpectedTerm = (beta*((((Consumption^theta)*((1-Labour)^(1-theta)))^(1-tau))/Consumption)*(alpha*((Output/Capital(-1))^(1-psi))+1-delta))^(1/(1-tau)); |
| 45 |
|
| 46 |
end; |
| 47 |
|
| 48 |
steady_state_model; |
| 49 |
efficiency = 0; |
| 50 |
Efficiency = effstar; |
| 51 |
// Compute steady state ratios. |
| 52 |
Output_per_unit_of_Capital=((1/beta-1+delta)/alpha)^(1/(1-psi)); |
| 53 |
Consumption_per_unit_of_Capital=Output_per_unit_of_Capital-delta; |
| 54 |
Labour_per_unit_of_Capital=(((Output_per_unit_of_Capital/Efficiency)^psi-alpha)/(1-alpha))^(1/psi); |
| 55 |
Output_per_unit_of_Labour=Output_per_unit_of_Capital/Labour_per_unit_of_Capital; |
| 56 |
Consumption_per_unit_of_Labour=Consumption_per_unit_of_Capital/Labour_per_unit_of_Capital; |
| 57 |
|
| 58 |
// Compute steady state share of capital. |
| 59 |
ShareOfCapital=alpha/(alpha+(1-alpha)*Labour_per_unit_of_Capital^psi); |
| 60 |
|
| 61 |
/// Compute steady state of the endogenous variables. |
| 62 |
Labour=1/(1+Consumption_per_unit_of_Labour/((1-alpha)*theta/(1-theta)*Output_per_unit_of_Labour^(1-psi))); |
| 63 |
Consumption = Consumption_per_unit_of_Labour*Labour; |
| 64 |
Capital = Labour/Labour_per_unit_of_Capital; |
| 65 |
Output = Output_per_unit_of_Capital*Capital; |
| 66 |
ExpectedTerm = (beta*((((Consumption^theta)*((1-Labour)^(1-theta)))^(1-tau))/Consumption)*(alpha*((Output/Capital)^(1-psi))+1-delta))^(1/(1-tau)); |
| 67 |
end; |
| 68 |
|
| 69 |
|
| 70 |
shocks; |
| 71 |
var EfficiencyInnovation = sigma2; |
| 72 |
end; |
| 73 |
|
| 74 |
steady; |
| 75 |
|
| 76 |
options_.ep.stack_solve_algo=0; // Only necessary with bytecode, even with the new version of the model (fixing orders of magnitude issue). Not clear why... |
| 77 |
|
| 78 |
extended_path(periods=2, order=0); |
| 79 |
|
| 80 |
if ~oo_.extended_path.status |
| 81 |
error('Extended path did not find solution in ep/rbc_bytecode.mod') |
| 82 |
end |