Skip to content

Commit f894e7d

Browse files
committed
update sources from lecture-python-advanced (d084574)
1 parent 2f697f0 commit f894e7d

9 files changed

Lines changed: 71 additions & 143 deletions

File tree

‎source/rst/arma.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ The package `scipy.signal` expects the parameters to be passed into its function
861861

862862
For example, the impulse response sequence $\{\psi_t\}$ discussed above can be obtained using `scipy.signal.dimpulse`, and the function call should be of the form
863863

864-
> `times, ψ = dimpulse((ma_poly, ar_poly, 1), n=impulse_length)`
864+
`times, ψ = dimpulse((ma_poly, ar_poly, 1), n=impulse_length)`
865865

866866
where `ma_poly` and `ar_poly` correspond to the polynomials in {eq}`arma_poly` --- that is,
867867

‎source/rst/chang_credible.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ compute a set of values associated with sustainable plans.
7676
Chang's operator $\tilde D(Z)$ is closely connected with the operator
7777
$D(Z)$ introduced in lecture {doc}`competitive equilibria in the Chang model <chang_ramsey>`.
7878

79-
>
80-
8179
* $\tilde D(Z)$ incorporates all of the restrictions imposed in
8280
constructing the operator $D(Z)$, but $\ldots$.
8381
* It adds some additional restrictions

‎source/rst/chang_ramsey.md‎

Lines changed: 39 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -488,11 +488,11 @@ two-step procedure to find at least the *value* of the Ramsey
488488
outcome to the representative household
489489
490490
1. Find the indirect value function $w(\theta)$ defined as
491-
492-
$$
493-
w(\theta) = \max_{(\vec m, \vec x, \vec h) \in \Gamma(\theta)} \sum_{t=0}^\infty \beta^t \left[ u(f(x_t)) + v(m_t) \right]
494-
$$
495-
491+
492+
$$
493+
w(\theta) = \max_{(\vec m, \vec x, \vec h) \in \Gamma(\theta)} \sum_{t=0}^\infty \beta^t \left[ u(f(x_t)) + v(m_t) \right]
494+
$$
495+
496496
1. Compute the value of the Ramsey outcome by solving $\max_{\theta \in \Omega} w(\theta)$.
497497
498498
Thus, Chang states the following
@@ -672,47 +672,43 @@ value, $\theta$ pairs.
672672

673673
Define the operator
674674

675-
> $$
676-
> D(Z) = \Bigl\{ (w,\theta): {\rm there \ is } \ h \in CE_\pi^0
677-
> $$
678-
>
679-
> $$
680-
> \text{ and a four-tuple } \ (m(h), x(h), w'(h), \theta'(h)) \in [0,\bar m]\times X \times Z
681-
> $$
682-
>
683-
>
675+
$$
676+
D(Z) = \Bigl\{ (w,\theta): {\rm there \ is } \ h \in CE_\pi^0
677+
$$
678+
679+
$$
680+
\text{ and a four-tuple } \ (m(h), x(h), w'(h), \theta'(h)) \in [0,\bar m]\times X \times Z
681+
$$
684682

685683
such that
686684

687-
> ```{math}
688-
> :label: eqn_chang_ramsey120
689-
>
690-
> w = u(f(x( h))) + v(m( h)) + \beta w'( h)
691-
> ```
692-
>
693-
> ```{math}
694-
> :label: eqn_chang_ramsey130
695-
>
696-
> \theta = u'(f(x( h))) ( m( h) + x( h))
697-
> ```
698-
>
699-
> ```{math}
700-
> :label: eqn_chang_ramsey_150
701-
>
702-
> x(h) = m(h) (h-1)
703-
> ```
704-
>
705-
> ```{math}
706-
> :label: eqn_chang_ramsey160
707-
>
708-
> m(h) (u'(f(x(h))) - v'(m(h))) \leq \beta \theta'(h)
709-
> ```
710-
>
711-
> $$
712-
> \quad \quad \ \text{ with equality if } m(h) < \bar m \Bigr\}
713-
> $$
714-
>
715-
>
685+
```{math}
686+
:label: eqn_chang_ramsey120
687+
688+
w = u(f(x( h))) + v(m( h)) + \beta w'( h)
689+
```
690+
691+
```{math}
692+
:label: eqn_chang_ramsey130
693+
694+
\theta = u'(f(x( h))) ( m( h) + x( h))
695+
```
696+
697+
```{math}
698+
:label: eqn_chang_ramsey_150
699+
700+
x(h) = m(h) (h-1)
701+
```
702+
703+
```{math}
704+
:label: eqn_chang_ramsey160
705+
706+
m(h) (u'(f(x(h))) - v'(m(h))) \leq \beta \theta'(h)
707+
```
708+
709+
$$
710+
\quad \quad \ \text{ with equality if } m(h) < \bar m \Bigr\}
711+
$$
716712

717713
It is possible to establish.
718714

‎source/rst/discrete_dp.md‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,6 @@ Let's now step through these ideas more carefully.
161161

162162
Formally, a discrete dynamic program consists of the following components:
163163

164-
>
165-
166164
1. A finite set of *states* $S = \{0, \ldots, n-1\}$.
167165
1. A finite set of *feasible actions* $A(s)$ for each state $s \in S$, and a corresponding set of *feasible state-action pairs*.
168166

@@ -404,10 +402,6 @@ We want to represent this model in the format of a discrete dynamic program.
404402

405403
To this end, we take
406404

407-
>
408-
409-
>
410-
411405
* the state variable to be the stock $s$
412406
* the state space to be $S = \{0, \ldots, M + B\}$
413407
* hence $n = M + B + 1$

‎source/rst/hs_recursive_models.md‎

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ Subsequent lectures use the DLE class to implement various instances that have a
5656
1. {doc}`Cattle cycles <cattle_cycles>`
5757
1. {doc}`Shock Non Invertibility <hs_invertibility_example>`
5858

59-
>
60-
6159
### Overview of the Models
6260

6361
In saying that "complete markets are all alike", Robert E. Lucas, Jr. was noting that all of them have
@@ -1264,16 +1262,14 @@ that satisfy the following conditions:
12641262
* Given the price system and given $h_{-1},\, k_{-1}$, the allocation solves the representative household’s problem and
12651263
the problems of the two types of firms.
12661264

1267-
>
1268-
12691265
Versions of the two classical welfare theorems prevail under our assumptions.
12701266

12711267
We exploit that fact in our algorithm for computing a competitive equilibrium.
12721268

12731269
**Step 1:** Solve the planning problem by using dynamic programming.
12741270

1275-
> The allocation (i.e., **quantities**) that solve the planning problem **are** the
1276-
> competitive equilibrium quantities.
1271+
The allocation (i.e., **quantities**) that solve the planning problem **are** the
1272+
competitive equilibrium quantities.
12771273

12781274
**Step 2:** use the following formulas to compute the **equilibrium price system**
12791275

@@ -1436,15 +1432,11 @@ Compare numbers of shocks in the two representations:
14361432

14371433
* $n_w + n_y$ versus $n_y$
14381434

1439-
>
1440-
14411435
Compare spaces spanned
14421436

14431437
* $H(y^t) \subset H(w^t,v^t)$
14441438
* $H(y^t) = H(a^t)$
14451439

1446-
>
1447-
14481440
**Kalman Filter:**.
14491441

14501442
Kalman gain:
@@ -1608,8 +1600,6 @@ if
16081600
- $\color{blue}{\Pi}$ is nonsingular, and
16091601
- the absolute values of the eigenvalues of $\color{blue}{(\Delta_h - \Theta_h \Pi^{-1}\Lambda)}$ are strictly less than $1/\sqrt\beta$.
16101602

1611-
>
1612-
16131603
**Key invertibility property:** A canonical household service
16141604
technology maps a service process $\{s_t\}$ in $L_0^2$
16151605
into a corresponding consumption process $\{c_t\}$ for which the
@@ -1790,8 +1780,6 @@ We provide details for a number of these examples in subsequent lectures
17901780
1. {doc}`Cattle cycles <cattle_cycles>`
17911781
1. {doc}`Shock Non Invertibility <hs_invertibility_example>`
17921782

1793-
>
1794-
17951783
We'll start with an example of a **partial equilibrium** in which we posit demand and supply curves
17961784

17971785
Suppose that we want to capture the dynamic demand curve:
@@ -1809,8 +1797,6 @@ From material described earlier in this lecture, we know how to reverse engineer
18091797

18101798
* note how the demand equations are cast in terms of the matrices in our standard preference representation
18111799

1812-
>
1813-
18141800
Now let's turn to supply.
18151801

18161802
A representative firm takes as given and beyond its control the
@@ -2111,11 +2097,8 @@ We'll describe a class of permanent income models that feature
21112097

21122098
- Many consumption goods and services
21132099
- A single capital good with $R \beta =1$
2114-
21152100
- The physical production technology
21162101

2117-
>
2118-
21192102
$$
21202103
\begin{aligned}
21212104
\phi_c \cdot c_t+i_t&=\gamma k_{t-1}+e_t \\

‎source/rst/lu_tricks.md‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ class of dynamic optimization and prediction problems by applying the method of
3333
* the one-step transition function is **linear**.
3434
* shocks are IID Gaussian or martingale differences.
3535

36-
>
37-
3836
In this lecture and a companion lecture {doc}`Classical Filtering with Linear Algebra <classical_filtering>`, we study the classical theory of linear-quadratic (LQ) optimal control problems.
3937

4038
The classical approach does not use the two closely related methods -- dynamic programming and Kalman filtering -- that we describe in other lectures, namely, [Linear Quadratic Dynamic Programming Problems](https://python-intro.quantecon.org/lqcontrol.html) and [A First Look at the Kalman Filter](https://python-intro.quantecon.org/kalman.html).
@@ -44,8 +42,6 @@ Instead, they use either
4442
* $z$-transform and lag operator methods, or
4543
* matrix decompositions applied to linear systems of first-order conditions for optimum problems.
4644

47-
>
48-
4945
In this lecture and the sequel {doc}`Classical Filtering with Linear Algebra <classical_filtering>`, we mostly rely on elementary linear algebra.
5046

5147
The main tool from linear algebra we'll put to work here is [LU decomposition](https://en.wikipedia.org/wiki/LU_decomposition).

‎source/rst/lucas_model.md‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ import matplotlib.pyplot as plt
6868

6969
Lucas studied a pure exchange economy with a representative consumer (or household), where
7070

71-
>
72-
7371
* *Pure exchange* means that all endowments are exogenous.
7472
* *Representative* consumer means that either
7573
* there is a single consumer (sometimes also referred to as a household), or
@@ -136,8 +134,6 @@ What is an appropriate price for a claim on the consumption endowment?
136134

137135
We'll price an *ex-dividend* claim, meaning that
138136

139-
>
140-
141137
* the seller retains this period's dividend
142138
* the buyer pays $p_t$ today to purchase a claim on
143139
* $y_{t+1}$ and

‎source/rst/opt_tax_recur.md‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ Here a *war* means a more or less temporary surge in an exogenous government ex
4444

4545
The model features
4646

47-
>
48-
4947
* a government that must finance an exogenous stream of government expenditures with either
5048
* a flat rate tax on labor, or
5149
* purchases and sales from a full array of Arrow state-contingent securities
@@ -579,8 +577,6 @@ $\vec u_c$.
579577

580578
Here is a computational algorithm:
581579

582-
>
583-
584580
1. Start with a guess for the value for $\Phi$, then use the
585581
first-order conditions and the feasibility conditions to compute
586582
$c(s_t), n(s_t)$ for $s \in [1,\ldots, S]$ and
@@ -1618,8 +1614,6 @@ plt.show()
16181614

16191615
**Tax smoothing**
16201616

1621-
>
1622-
16231617
* the tax rate is constant for all $t\geq 1$
16241618
* For $t \geq 1, t \neq 3$, this is a consequence of $g_t$
16251619
being the same at all those dates.
@@ -1671,15 +1665,11 @@ At time $t=0$ the government evidently *dissaves* since $b_1> b_0$.
16711665
* This is a consequence of it setting a *lower* tax rate at $t=0$,
16721666
implying more consumption at $t=0$.
16731667

1674-
>
1675-
16761668
At time $t=1$, the government evidently *saves* since it has set the tax
16771669
rate sufficiently high to allow it to set $b_2 < b_1$.
16781670

16791671
* Its motive for doing this is that it anticipates a likely war at $t=3$.
16801672

1681-
>
1682-
16831673
At time $t=2$ the government trades state-contingent Arrow securities
16841674
to hedge against war at $t=3$.
16851675

@@ -1691,8 +1681,6 @@ to hedge against war at $t=3$.
16911681
* The time $t=4$ debt level can be serviced with revenues from the
16921682
constant tax rate set at times $t\geq 1$.
16931683

1694-
>
1695-
16961684
At times $t \geq 4$ the government rolls over its debt, knowing that the
16971685
tax rate is set at a level that raises enough revenue to pay for government purchases and interest payments
16981686
on its debt.
@@ -1773,8 +1761,6 @@ The first is $b_{0} = 0$
17731761
* Here the government can't use the $t=0$ tax rate to alter the
17741762
value of the initial debt.
17751763

1776-
>
1777-
17781764
The second occurs when the government enters with sufficiently large assets
17791765
that the Ramsey planner can achieve first best and sets $\tau_t = 0$
17801766
for all $t$.

0 commit comments

Comments
 (0)