This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy import interp | |
from quantecon.models import ConsumerProblem | |
from quantecon import mc_sample_path | |
from quantecon import compute_fixed_point | |
import matplotlib.pyplot as plt | |
from mpl_toolkits.mplot3d import Axes3D | |
def compute_longrun_series(cp, T=500000, verbose=False): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy.optimize import fminbound, brentq | |
from scipy import interp | |
class ConsumerProblem: | |
def __init__(self, eta=0.5, r=0.01, beta=0.96, Pi=((0.6, 0.4), (0.05, 0.95)), | |
z_vals=(0.5, 1.0), phi=0, grid_max=16, grid_size=50): | |
self.eta = eta | |
self.r, self.R = r, 1 + r |