Skip to content

Commit

Permalink
Remove unused imports (#357)
Browse files Browse the repository at this point in the history
* Remove unused imports

* Fix import errors
  • Loading branch information
Smit-create authored Aug 16, 2023
1 parent 47eecc5 commit bab7a8e
Show file tree
Hide file tree
Showing 27 changed files with 505 additions and 547 deletions.
12 changes: 6 additions & 6 deletions lectures/_static/lecture_specific/optgrowth_fast/ogm.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from numba import float64
from numba.experimental import jitclass

opt_growth_data = [
('α', float64), # Production parameter
Expand All @@ -12,8 +14,8 @@
class OptimalGrowthModel:

def __init__(self,
α=0.4,
β=0.96,
α=0.4,
β=0.96,
μ=0,
s=0.1,
grid_max=4,
Expand All @@ -29,12 +31,12 @@ def __init__(self,
# Store shocks (with a seed, so results are reproducible)
np.random.seed(seed)
self.shocks = np.exp(μ + s * np.random.randn(shock_size))


def f(self, k):
"The production function"
return k**self.α


def u(self, c):
"The utility function"
Expand All @@ -52,5 +54,3 @@ def u_prime(self, c):
def u_prime_inv(self, c):
"Inverse of u'"
return 1/c


12 changes: 6 additions & 6 deletions lectures/_static/lecture_specific/optgrowth_fast/ogm_crra.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

from numba import float64
from numba.experimental import jitclass

opt_growth_data = [
('α', float64), # Production parameter
Expand All @@ -14,11 +15,11 @@
class OptimalGrowthModel_CRRA:

def __init__(self,
α=0.4,
β=0.96,
α=0.4,
β=0.96,
μ=0,
s=0.1,
γ=1.5,
γ=1.5,
grid_max=4,
grid_size=120,
shock_size=250,
Expand All @@ -32,7 +33,7 @@ def __init__(self,
# Store shocks (with a seed, so results are reproducible)
np.random.seed(seed)
self.shocks = np.exp(μ + s * np.random.randn(shock_size))


def f(self, k):
"The production function."
Expand All @@ -52,4 +53,3 @@ def u_prime(self, c):

def u_prime_inv(c):
return c**(-1 / self.γ)

2 changes: 0 additions & 2 deletions lectures/aiyagari.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ Let's start with some imports:
import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = (11, 5) #set default figure size
import numpy as np
import quantecon as qe
from quantecon.markov import DiscreteDP
from numba import jit
```
Expand Down Expand Up @@ -441,4 +440,3 @@ ax.legend(loc='upper right')
plt.show()
```

4 changes: 1 addition & 3 deletions lectures/coleman_policy_iter.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,9 @@ Let's start with some imports:
import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = (11, 5) #set default figure size
import numpy as np
import quantecon as qe
from interpolation import interp
from quantecon.optimize import brentq
from numba import njit, float64
from numba.experimental import jitclass
from numba import njit
```

## The Euler Equation
Expand Down
7 changes: 1 addition & 6 deletions lectures/egm_policy_iter.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ In addition to what's in Anaconda, this lecture will need the following librarie
---
tags: [hide-output]
---
!pip install quantecon
!pip install interpolation
```

Expand All @@ -55,11 +54,8 @@ Let's start with some standard imports:
import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = (11, 5) #set default figure size
import numpy as np
import quantecon as qe
from interpolation import interp
from numba import njit, float64
from numba.experimental import jitclass
from quantecon.optimize import brentq
from numba import njit
```

## Key Idea
Expand Down Expand Up @@ -266,4 +262,3 @@ has managed to shave off still more run time without compromising accuracy.
This is due to the lack of a numerical root-finding step.

We can now solve the optimal growth model at given parameters extremely fast.

2 changes: 1 addition & 1 deletion lectures/geom_series.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = (11, 5) #set default figure size
import numpy as np
import sympy as sym
from sympy import init_printing, latex
from sympy import init_printing
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D
```
Expand Down
Loading

0 comments on commit bab7a8e

Please sign in to comment.