def __init__(self, A=1.4, ?=0.6, ?=0.96, grid_size=50,
G=None, ?=np.sqrt, F=stats.beta(2, 2)):
self.A, self.?, self.? = A, ?, ?
# === set defaults for G, ? and F === #
self.G = G if G is not None else lambda x, ?: A * (x * ?)**?
self.? = ?
self.F = F
# === Set up grid over the state space for DP === #
# Max of grid is the max of a large quantile value for F and the
# fixed point y = G(y, 1).
grid_max = max(A**(1 / (1 - ?)), self.F.ppf(1 - ?))
self.x_grid = np.linspace(?, grid_max, grid_size)
评论列表
文章目录