rbcii.mod 2.28 KB
Newer Older
1
@#define extended_path_version = 1
2

3
var Capital, Output, Labour, Consumption, Investment, Efficiency, efficiency, ExpectedTerm;
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

varexo EfficiencyInnovation;

parameters beta, theta, tau, alpha, psi, delta, rho, effstar, sigma2;

/*
** Calibration
*/


beta    =  0.990;
theta   =  0.357;
tau     =  2.000;
alpha   =  0.450;
psi     =  -0.500;
delta   =  0.020;
rho     =  0.995;
effstar =  1.000;
sigma2  =  0.001;


@#if extended_path_version
    rho = 0.800;
@#endif
28

29
30
external_function(name=mean_preserving_spread);

31
model(use_dll);
32
33
34
35
36
37
38
39
40
41
42

  // Eq. n°1:
  efficiency = rho*efficiency(-1) + EfficiencyInnovation;

  // Eq. n°2:
  Efficiency = effstar*exp(efficiency-mean_preserving_spread(rho));

  // Eq. n°3:
  Output = Efficiency*(alpha*(Capital(-1)^psi)+(1-alpha)*(Labour^psi))^(1/psi);

  // Eq. n°4:
43
  Capital = max(Output-Consumption,0) + (1-delta)*Capital(-1);
44
45
46
47
48

  // Eq. n°5:
  ((1-theta)/theta)*(Consumption/(1-Labour)) - (1-alpha)*(Output/Labour)^(1-psi);

  // Eq. n°6:
49
  ExpectedTerm = beta*((((Consumption^theta)*((1-Labour)^(1-theta)))^(1-tau))/Consumption)*(alpha*((Output/Capital(-1))^(1-psi))+1-delta);
50
51

  // Eq. n°7:
52
  Investment = Capital - (1-delta)*Capital(-1);
53

54
55
  // Eq. n°8: (Euler equation, to be skipped if investment is on its lower bound)
  (Investment>0)*((((Consumption^theta)*((1-Labour)^(1-theta)))^(1-tau))/Consumption - ExpectedTerm(1)) + (1-(Investment>0))*(Output-Consumption);
56
57
58
59
60
61
62
63
64
65
66

end;


@#if extended_path_version

    shocks;
    var EfficiencyInnovation = sigma2;
    end;

    steady;
67

68
69
    options_.maxit_ = 100;
    options_.ep.verbosity = 0;
70
    options_.ep.stochastic.status = 0;
71
72
    options_.console_mode = 0;

73
    ts = extended_path([],1000);
74

75
    options_.ep.stochastic.status = 1;
76
    sts = extended_path([],1000);
77

78
    figure(1)
79
80
    plot(ts(2,:)-ts(4,:));

81
82
83
84
85
    figure(2)
    plot(sts(2,:)-sts(4,:));

    figure(3)
    plot(sts(2,:)-ts(2,:))
86

87
88
89
90
91
92
93
94
95
@#else

    shocks;
    var EfficiencyInnovation;
    periods 1;
    values -.4;
    end;

    steady;
96

97
    options_.maxit_ = 100;
98

99
100
101
    simul(periods=4000);

    n = 100;
102
103

    figure('Name','(rbcii) Investment.');
104
    plot(Output(1:n)-Consumption(1:n),'-b','linewidth',2)
105
106
107

    figure('Name','(rbcii) Lagrange multiplier associated to the positivity constraint on investment.');
    plot(LagrangeMultiplier(1:n),'-b','linewidth',2)
108

109
@#endif