-
Notifications
You must be signed in to change notification settings - Fork 2
/
Cho_and_Moreno.m
41 lines (28 loc) · 1.22 KB
/
Cho_and_Moreno.m
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
% Based on Cho and Moreno (2011, Journal of Econ Dynamics and Control)
% Recursive algorithm for computing the unique fixed-structure fundamental
% rational expectations solution that satisfies the no-bubbles condition
% Written by Michael Hatcher ([email protected]). Any errors are my own.
%Cho and Moreno (2011) method for computing fixed structure solutions
J = 10000; %no. iterations
%% Warning: DO NOT AMEND. Structures are specified in the main files.
if abs(det(B1)) > 0
A = B1 \ B2; B = B1 \ B3; C = B1 \ B4; D = B1 \ B5;
%Note R = 0_{m \times m} as shocks in e(t) are white noise. Persistent shocks can be included in x(t).
%See Kulish and Pagan (2017, Journal of Applied Econometrics)
%Taken from main file
I = eye(length(B1));
%Initial values (run main file with structure)
AT = A; BT = B; CT = C; DT = D;
for i=1:J
AT = (I - A*BT) \ A*AT;
CT = (I - A*BT) \ C; %Since R = 0_{ m \times m}
DT = (I - A*BT) \ (D + A*DT);
BT = (I - A*BT) \ B;
end
%Check1 = AT
%Solution matrices
Omega_bar = BT; Gama_bar = CT; Psi_bar = DT;
else
disp('Matrix B1 non-invertible or not well defined')
run Cho_Moreno_alternative
end