rbcii.mod 2.15 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
@#define extended_path_version = 1

var Capital, Output, Labour, Consumption, Efficiency, efficiency, ExpectedTerm, LagrangeMultiplier;

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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
external_function(name=mean_preserving_spread);

model(block,bytecode,cutoff=0);

  // 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:
  Capital = max(Output-Consumption + (1-delta)*Capital(-1),(1-delta)*Capital(-1));

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

  // Eq. n°6:
  (((Consumption^theta)*((1-Labour)^(1-theta)))^(1-tau))/Consumption - LagrangeMultiplier  - ExpectedTerm(1);

  // Eq. n°7:
  (Capital==(1-delta)*Capital(-1))*(Output-Consumption) + (1-(Capital==(1-delta)*Capital(-1)))*LagrangeMultiplier = 0;
  
  // Eq. n°8:
  ExpectedTerm = beta*(((((Consumption^theta)*((1-Labour)^(1-theta)))^(1-tau))/Consumption)*(alpha*((Output/Capital(-1))^(1-psi))+(1-delta))-(1-delta)*LagrangeMultiplier);

end;


@#if extended_path_version

    shocks;
    var EfficiencyInnovation = sigma2;
    end;

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

73
74
    ts = extended_path([],1000);
    
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
86
    figure(2)
    plot(sts(2,:)-sts(4,:));

    figure(3)
    plot(sts(2,:)-ts(2,:))
    
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
@#else

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

    steady;
    
    options_.maxit_ = 100;
    
    simul(periods=4000);

    n = 100;
    plot(Output(1:n)-Consumption(1:n),'-b','linewidth',2)
    
@#endif