#!/usr/bin/env python # coding: utf-8 # # Modelling with RBC # # ## Introduction # # Here, we'll see an example of macro modelling: a real business cycle model. This example is due to [Chad Fulton](http://www.chadfulton.com/). # # In[ ]: import matplotlib.pyplot as plt import numpy as np import pandas as pd from sympy import * # Set max rows displayed for readability pd.set_option("display.max_rows", 6) # Plot settings plt.style.use( "https://github.com/aeturrell/coding-for-economists/raw/main/plot_style.txt" ) # Set seed for random numbers seed_for_prng = 78557 prng = np.random.default_rng( seed_for_prng ) # prng=probabilistic random number generator # ## Model specification # # # $$ # \max \mathbb{E}_0 \sum_{t=0}^\infty \beta^t u(c_t, l_t) # $$ # # the budget constraint: yt=ct+it # the capital accumulation equation: kt+1=(1−δ)kt+it # 1=lt+nt # # where households have the following production technology: # # $$ # y_t = z_t f(k_t, n_t) # $$ # and where the (log of the) technology process follows an AR(1) process: # # $$ # \log z_t = \rho \log z_{t-1} + \varepsilon_t, \qquad \varepsilon_t \sim N(0, \sigma^2) # $$