Skip to content

Commit 4dcd462

Browse files
committed
Remove unused imports
1 parent 2387665 commit 4dcd462

22 files changed

+315
-379
lines changed

lectures/BCG_complete_mkts.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -802,44 +802,44 @@ It consists of 4 functions that do the following things:
802802
- First, create a grid for capital.
803803
- Then for each value of capital stock in the grid, compute the left side of the planner's
804804
first-order necessary condition for $k$, that is,
805-
805+
806806
$$
807807
\beta \alpha A K^{\alpha -1} \int \left( \frac{w_1(\epsilon) + A K^\alpha e^\epsilon}{w_0 - K } \right)^{-\gamma} e^\epsilon g(\epsilon) d \epsilon - 1 =0
808808
$$
809-
809+
810810
- Find $k$ that solves this equation.
811811
* `q` computes Arrow security prices as a function of the productivity shock $\epsilon$ and capital $K$:
812-
812+
813813
$$
814814
q(\epsilon;K) = \beta \left( \frac{u'\left( w_1(\epsilon) + A K^\alpha e^\epsilon\right)} {u'(w_0 - K )} \right)
815815
$$
816-
816+
817817
* `V` solves for the firm value given capital $k$:
818-
818+
819819
$$
820820
V = - k + \int A k^\alpha e^\epsilon q(\epsilon; K) d \epsilon
821821
$$
822-
822+
823823
* `opt_c` computes optimal consumptions $c^i_0$, and $c^i(\epsilon)$:
824824
- The function first computes weight $\eta$ using the
825825
budget constraint for agent 1:
826-
826+
827827
$$
828828
w_0^1 + \theta_0^1 V + \int w_1^1(\epsilon) q(\epsilon) d \epsilon
829829
= c_0^1 + \int c_1^1(\epsilon) q(\epsilon) d \epsilon
830830
= \eta \left( C_0 + \int C_1(\epsilon) q(\epsilon) d \epsilon \right)
831831
$$
832832
where
833-
833+
834834
$$
835835
\begin{aligned}
836836
C_0 & = w_0 - K \cr
837837
C_1(\epsilon) & = w_1(\epsilon) + A K^\alpha e^\epsilon \cr
838838
\end{aligned}
839839
$$
840-
840+
841841
- It computes consumption for each agent as
842-
842+
843843
$$
844844
\begin{aligned}
845845
c_0^1 & = \eta C_0 \cr
@@ -848,7 +848,7 @@ It consists of 4 functions that do the following things:
848848
c_1^2 (\epsilon) & = (1 - \eta) C_1(\epsilon)
849849
\end{aligned}
850850
$$
851-
851+
852852

853853
The list of parameters includes:
854854

@@ -868,7 +868,6 @@ The list of parameters includes:
868868
Gauss-Hermite quadrature: default value is 10
869869

870870
```{code-cell} ipython
871-
import pandas as pd
872871
import numpy as np
873872
import matplotlib.pyplot as plt
874873
from scipy.stats import norm
@@ -1205,4 +1204,3 @@ Image(fig.to_image(format="png"))
12051204
# fig.show() will provide interactive plot when running
12061205
# notebook locally
12071206
```
1208-

lectures/BCG_incomplete_mkts.md

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -581,47 +581,47 @@ Here goes:
581581
$|\theta^1_h - \theta^1_l|$ is large:
582582
* Compute agent 1’s valuation of the equity claim with a
583583
fixed-point iteration:
584-
584+
585585
$q_1 = \beta \int \frac{u^\prime(c^1_1(\epsilon))}{u^\prime(c^1_0)} d^e(k,b;\epsilon) g(\epsilon) \ d\epsilon$
586-
586+
587587
where
588-
588+
589589
$c^1_1(\epsilon) = w^1_1(\epsilon) + \theta^1 d^e(k,b;\epsilon)$
590-
590+
591591
and
592-
592+
593593
$c^1_0 = w^1_0 + \theta^1_0V - q_1\theta^1$
594594
* Compute agent 2’s valuation of the bond claim with a
595595
fixed-point iteration:
596-
596+
597597
$p = \beta \int \frac{u^\prime(c^2_1(\epsilon))}{u^\prime(c^2_0)} d^b(k,b;\epsilon) g(\epsilon) \ d\epsilon$
598-
598+
599599
where
600-
600+
601601
$c^2_1(\epsilon) = w^2_1(\epsilon) + \theta^2 d^e(k,b;\epsilon) + b$
602-
602+
603603
and
604-
604+
605605
$c^2_0 = w^2_0 + \theta^2_0 V - q_1 \theta^2 - pb$
606606
* Compute agent 2’s valuation of the equity claim with a
607607
fixed-point iteration:
608-
608+
609609
$q_2 = \beta \int \frac{u^\prime(c^2_1(\epsilon))}{u^\prime(c^2_0)} d^e(k,b;\epsilon) g(\epsilon) \ d\epsilon$
610-
610+
611611
where
612-
612+
613613
$c^2_1(\epsilon) = w^2_1(\epsilon) + \theta^2 d^e(k,b;\epsilon) + b$
614-
614+
615615
and
616-
616+
617617
$c^2_0 = w^2_0 + \theta^2_0 V - q_2 \theta^2 - pb$
618618
* If $q_1 > q_2$, Set $\theta_l = \theta^1$;
619619
otherwise, set $\theta_h = \theta^1$.
620620
* Repeat steps 6Aa through 6Ad until
621621
$|\theta^1_h - \theta^1_l|$ is small.
622622
1. Set bond price as $p$ and equity price as $q = \max(q_1,q_2)$.
623623
1. Compute optimal choices of consumption:
624-
624+
625625
$$
626626
\begin{aligned}
627627
c^1_0 &= w^1_0 + \theta^1_0V - q\theta^1 \\
@@ -630,29 +630,29 @@ Here goes:
630630
c^2_1(\epsilon) &= w^2_1(\epsilon) + \theta^2 d^e(k,b;\epsilon) + b
631631
\end{aligned}
632632
$$
633-
633+
634634
1. (Here we confess to abusing notation again, but now in a different
635635
way. In step 7, we interpret frozen $c^i$s as Big
636636
$C^i$. We do this to solve the firm’s problem.) Fixing the
637637
values of $c^i_0$ and $c^i_1(\epsilon)$, compute optimal
638638
choices of capital $k$ and debt level $b$ using the
639639
firm’s first order necessary conditions.
640640
1. Compute deviations from the firm’s FONC for capital $k$ as:
641-
641+
642642
$kfoc = \beta \alpha A k^{\alpha - 1} \left( \int \frac{u^\prime(c^2_1(\epsilon))}{u^\prime(c^2_0)} e^\epsilon g(\epsilon) \ d\epsilon \right) - 1$
643643
- If $kfoc > 0$, Set $k_l = k$; otherwise, set
644644
$k_h = k$.
645645
- Repeat steps 4 through 7A until $|k_h-k_l|$ is small.
646646
1. Compute deviations from the firm’s FONC for debt level $b$ as:
647-
647+
648648
$bfoc = \beta \left[ \int_{\epsilon^*}^\infty \left( \frac{u^\prime(c^1_1(\epsilon))}{u^\prime(c^1_0)} \right) g(\epsilon) \ d\epsilon - \int_{\epsilon^*}^\infty \left( \frac{u^\prime(c^2_1(\epsilon))}{u^\prime(c^2_0)} \right) g(\epsilon) \ d\epsilon \right]$
649649
- If $bfoc > 0$, Set $b_h = b$; otherwise, set
650650
$b_l = b$.
651651
- Repeat steps 3 through 7B until $|b_h-b_l|$ is small.
652652
1. Given prices $q$ and $p$ from step 6, and the firm
653653
choices of $k$ and $b$ from step 7, compute the synthetic
654654
firm value:
655-
655+
656656
$V_x = -k + q + pb$
657657
- If $V_x > V$, then set $V_l = V$; otherwise, set
658658
$V_h = V$.
@@ -705,12 +705,9 @@ Parameters include:
705705
- bound: Bound for truncated normal distribution. Default value is 3.
706706

707707
```{code-cell} ipython
708-
import pandas as pd
709708
import numpy as np
710-
from scipy.stats import norm
711709
from scipy.stats import truncnorm
712710
from scipy.integrate import quad
713-
from scipy.optimize import bisect
714711
from numba import njit
715712
from interpolation import interp
716713
```
@@ -1943,4 +1940,3 @@ Agents of type 2 value bonds more highly (they want more hedging).
19431940

19441941
Taken together with our earlier plot of equity holdings, these graphs confirm our earlier conjecture that while both type
19451942
of agents hold equities, only agents of type 2 holds bonds.
1946-

lectures/additive_functionals.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ Let's start with some imports:
7575

7676
```{code-cell} ipython3
7777
import numpy as np
78-
import scipy as sp
7978
import scipy.linalg as la
8079
import quantecon as qe
8180
import matplotlib.pyplot as plt

lectures/amss.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,8 @@ Let's start with following imports:
4141
```{code-cell} ipython
4242
import numpy as np
4343
import matplotlib.pyplot as plt
44-
from scipy.optimize import root
45-
from interpolation.splines import eval_linear, UCGrid, nodes
46-
from quantecon import optimize, MarkovChain
47-
from numba import njit, prange, float64
48-
from numba.experimental import jitclass
44+
from interpolation.splines import UCGrid, nodes
45+
from quantecon import MarkovChain
4946
5047
%matplotlib inline
5148
```
@@ -1033,4 +1030,3 @@ problem, there exists another realization $\tilde s^t$ with
10331030
the same history up until the previous period, i.e., $\tilde s^{t-1}=
10341031
s^{t-1}$, but where the multiplier on constraint {eq}`AMSS_46` takes a positive value, so
10351032
$\gamma_t(\tilde s^t)>0$.
1036-

lectures/arellano.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,8 @@ Let's start with some imports:
7878
import matplotlib.pyplot as plt
7979
import numpy as np
8080
import quantecon as qe
81-
import random
8281
83-
from numba import njit, int64, float64, prange
84-
from numba.experimental import jitclass
82+
from numba import njit, prange
8583
%matplotlib inline
8684
```
8785

0 commit comments

Comments
 (0)