def __init__(self,
?=2,
?=0.95,
?=0.90,
?=0.1,
grid_size=100):
self.?, self.?, self.?, self.? = ?, ?, ?, ?
# == Set the grid interval to contain most of the mass of the
# stationary distribution of the consumption endowment == #
ssd = self.? / np.sqrt(1 - self.?**2)
grid_min, grid_max = np.exp(-4 * ssd), np.exp(4 * ssd)
self.grid = np.linspace(grid_min, grid_max, grid_size)
self.grid_size = grid_size
# == set up distribution for shocks == #
self.? = lognorm(?)
self.draws = self.?.rvs(500)
# == h(y) = ? * int G(y,z)^(1-?) ?(dz) == #
self.h = np.empty(self.grid_size)
for i, y in enumerate(self.grid):
self.h[i] = ? * np.mean((y**? * self.draws)**(1 - ?))
## == Now the functions that act on a Lucas Tree == #
评论列表
文章目录