kim2.mod 2.2 KB
Newer Older
Marco Ratto's avatar
Marco Ratto committed
1
2
3
4
5
6
7
8
9
10
11
var c k i a lam;
varexo ea;

parameters
alph
betae
delta
as
s
theta
phi
12
dumpy
Marco Ratto's avatar
Marco Ratto committed
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
;


alph=0.6;
betae=0.99;
delta=0.0125;
as=0.1;
phi=2;
s=betae*delta*alph/(1-betae+delta*betae);
theta=1;

model;
//(1-(betae*delta*alph/(1-betae+delta*betae)))^theta/c^(1+theta)/(1+theta)*(1+theta)*(i/(betae*delta*alph/(1-betae+delta*betae)))^theta*(i/k/delta)^phi=betae*(1-(betae*delta*alph/(1-betae+delta*betae)))^theta/c(+1)^(1+theta)/(1+theta)*(alph*(1+theta)*a(+1)^(1+theta)*k^(alph*(1+theta)-1)+(1-delta)*(i(+1)/k/delta)^phi*(1+theta)*(i(+1)/(betae*delta*alph/(1-betae+delta*betae)))^theta);
lam*(1+theta)*(i/(betae*delta*alph/(1-betae+delta*betae)))^theta*(i/k/delta)^phi=betae*lam(+1)*(alph*(1+theta)*a(+1)^(1+theta)*k^(alph*(1+theta)-1)+(1-delta)*(i(+1)/k/delta)^phi*(1+theta)*(i(+1)/(betae*delta*alph/(1-betae+delta*betae)))^theta);
k=(delta*(i/delta)^(1-phi)+(1-delta)*k(-1)^(1-phi))^(1/(1-phi));
((1-(betae*delta*alph/(1-betae+delta*betae)))*(c/(1-(betae*delta*alph/(1-betae+delta*betae))))^(1+theta) + 
(betae*delta*alph/(1-betae+delta*betae))*(i/(betae*delta*alph/(1-betae+delta*betae)))^(1+theta))^(1/(1+theta))=
(a*k(-1)^alph);
a = as+ea;
Marco Ratto's avatar
Marco Ratto committed
32
lam = (1-(betae*delta*alph/(1-betae+delta*betae)))^theta/c^(1+theta)/(1+theta);
33
//cobs = c+ec;
Marco Ratto's avatar
Marco Ratto committed
34
35
end;

36
37
38
39
40
41
42
43
44
steady_state_model;
s=betae*delta*alph/(1-betae+delta*betae);
a=as; %as^((1-alph)/(1+theta))*(delta^((phi+theta+1)/(theta+1))/s)^alph;
k=(delta/s/a)^(1/(alph-1));
i=delta*k;
c=(((a*k^alph)^(1+theta)-s*(i/s)^(1+theta))/(1-s))^(1/(1+theta))*(1-s);
lam = (1-s)^theta/c^(1+theta)/(1+theta);
end;

Marco Ratto's avatar
Marco Ratto committed
45
46
47
48
49
steady;
check;

shocks;
var ea = 1;
Marco Ratto's avatar
Marco Ratto committed
50
//var ec = 0;
Marco Ratto's avatar
Marco Ratto committed
51
52
53
end;

estimated_params;
54
alph ,uniform_pdf, , ,0.5,0.7;
Marco Ratto's avatar
Marco Ratto committed
55
56
//betae ,uniform_pdf,0.99,0.004,0.98,1;
//delta ,uniform_pdf,0.0125,0.001,0.01,0.015;
57
58
59
phi ,uniform_pdf, , ,0,10;
theta ,uniform_pdf, , ,0,10;
dumpy ,uniform_pdf, , ,0,10;
Marco Ratto's avatar
Marco Ratto committed
60
61
62
end;

varobs c i;
63
64
65
66
67

/* Skip test under MATLAB R2009b
   MATLAB crashes, most likely due to an internal bug */
if isoctave || ~matlab_ver_less_than('7.10')

68
identification(advanced=1,max_dim_cova_group=3);
Marco Ratto's avatar
Marco Ratto committed
69
//varobs c i lam; //to check if observing lam identifies phi and theta
70
//identification(ar=1,advanced=1,max_dim_cova_group=3,prior_mc=250);
Marco Ratto's avatar
Marco Ratto committed
71
//identification(prior_mc=100);
72
73
74
75


estim_params_=[]; 
identification(advanced=1,max_dim_cova_group=3);
76
77

end