Skip to content

Commit

Permalink
Merge 7f6ebd7 into 0e56dba
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanhobbs committed May 10, 2020
2 parents 0e56dba + 7f6ebd7 commit bce2fa1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions quantecon/dle.py
@@ -1,5 +1,5 @@
"""
Provides a class called DLE to convert and solve dynamic linear economics
Provides a class called DLE to convert and solve dynamic linear economies
(as set out in Hansen & Sargent (2013)) as LQ problems.
"""

Expand Down Expand Up @@ -69,15 +69,14 @@ def __init__(self, information, technology, preferences):
self.nb, self.nh = self.llambda.shape
self.nd, self.nc = self.phic.shape
self.nz, self.nw = self.c2.shape
junk, self.ng = self.phig.shape
self.junk, self.ng = self.phig.shape
self.nk, self.ni = self.thetak.shape

# === Creation of various useful matrices === #
uc = np.hstack((np.eye(self.nc), np.zeros((self.nc, self.ng))))
ug = np.hstack((np.zeros((self.ng, self.nc)), np.eye(self.ng)))
phiin = np.linalg.inv(np.hstack((self.phic, self.phig)))
phiinc = uc.dot(phiin)
phiing = ug.dot(phiin)
b11 = - self.thetah.dot(phiinc).dot(self.phii)
a1 = self.thetah.dot(phiinc).dot(self.gamma)
a12 = np.vstack((self.thetah.dot(phiinc).dot(
Expand Down Expand Up @@ -306,7 +305,6 @@ def canonical(self):
Ac2 = np.hstack((np.zeros((self.nz, self.nh)), self.a22))
Ac = np.vstack((Ac1, Ac2))
Bc = np.vstack((self.thetah, np.zeros((self.nz, self.nc))))
Cc = np.vstack((np.zeros((self.nh, self.nw)), self.c2))
Rc1 = np.hstack((self.llambda.T.dot(self.llambda), -
self.llambda.T.dot(self.ub)))
Rc2 = np.hstack((-self.ub.T.dot(self.llambda), self.ub.T.dot(self.ub)))
Expand Down

0 comments on commit bce2fa1

Please sign in to comment.