Skip to content

Commit ddb184a

Browse files
committed
remove interpolation in lecture series
1 parent 7a09aae commit ddb184a

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lectures/heavy_tails.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ In addition to what's in Anaconda, this lecture will need the following librarie
1919
```{code-cell} ipython3
2020
:tags: [hide-output]
2121
22-
!pip install --upgrade yfinance pandas_datareader interpolation
22+
!pip install --upgrade yfinance pandas_datareader
2323
```
2424

2525
We use the following imports.
@@ -31,7 +31,6 @@ import yfinance as yf
3131
import pandas as pd
3232
import statsmodels.api as sm
3333
34-
from interpolation import interp
3534
from pandas_datareader import wb
3635
from scipy.stats import norm, cauchy
3736
from pandas.plotting import register_matplotlib_converters
@@ -602,7 +601,7 @@ def empirical_ccdf(data,
602601
fw = np.empty_like(aw, dtype='float64')
603602
for i, a in enumerate(aw):
604603
fw[i] = a / np.sum(aw)
605-
pdf = lambda x: interp(data, fw, x)
604+
pdf = lambda x: np.interp(x, data, fw)
606605
data = np.sort(data)
607606
j = 0
608607
for i, d in enumerate(data):

lectures/inequality.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ We will install the following libraries.
6868
```{code-cell} ipython3
6969
:tags: [hide-output]
7070
71-
!pip install --upgrade quantecon interpolation
71+
!pip install quantecon
7272
```
7373

7474
And we use the following imports.
@@ -79,7 +79,6 @@ import numpy as np
7979
import matplotlib.pyplot as plt
8080
import quantecon as qe
8181
import random as rd
82-
from interpolation import interp
8382
```
8483

8584
## The Lorenz curve
@@ -746,7 +745,7 @@ Here is one solution:
746745
747746
```{code-cell} ipython3
748747
def lorenz2top(f_val, l_val, p=0.1):
749-
t = lambda x: interp(f_val, l_val, x)
748+
t = lambda x: np.interp(x, f_val, l_val)
750749
return 1- t(1 - p)
751750
```
752751

0 commit comments

Comments
 (0)