Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions lectures/lqramsey.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ jupytext:
text_representation:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.16.7
kernelspec:
display_name: Python 3
display_name: Python 3 (ipykernel)
language: python
name: python3
---
Expand All @@ -25,10 +27,9 @@ kernelspec:

In addition to what's in Anaconda, this lecture will need the following libraries:

```{code-cell} ipython
---
tags: [hide-output]
---
```{code-cell} ipython3
:tags: [hide-output]

!pip install --upgrade quantecon
```

Expand Down Expand Up @@ -73,7 +74,7 @@ We cover only the key features of the problem in this lecture, leaving you to re

We'll need the following imports:

```{code-cell} ipython
```{code-cell} ipython3
import sys
import numpy as np
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -583,7 +584,7 @@ The following code provides functions for

Description and clarifications are given below

```{code-cell} python3
```{code-cell} ipython3
# Set up a namedtuple to store data on the model economy
Economy = namedtuple('economy',
('β', # Discount factor
Expand Down Expand Up @@ -694,7 +695,7 @@ def compute_paths(T, econ):
a0 = 0.5 * (F @ (x_vals.T @ Sm.T)**2)[0]
H = ((Sb - Sd + Sg) @ x_vals) * ((Sg - Ss) @ x_vals)
b0 = 0.5 * (F @ H.T)[0]
a0, b0 = float(a0), float(b0)
a0, b0 = float(a0[0]), float(b0[0])
else:
H = Sm.T @ Sm
a0 = 0.5 * var_quadratic_sum(A, C, H, β, x0)
Expand Down Expand Up @@ -889,7 +890,7 @@ with $\rho = 0.7$, $\mu_g = 0.35$ and $C_g = \mu_g \sqrt{1 - \rho^2} / 10$.

Here's the code

```{code-cell} python3
```{code-cell} ipython3
# == Parameters == #
β = 1 / 1.05
ρ, mg = .7, .35
Expand All @@ -915,7 +916,7 @@ The legends on the figures indicate the variables being tracked.
Most obvious from the figure is tax smoothing in the sense that tax revenue is
much less variable than government expenditure.

```{code-cell} python3
```{code-cell} ipython3
gen_fig_2(path)
```

Expand All @@ -931,7 +932,7 @@ See the original [manuscript](https://lectures.quantecon.org/_downloads/firenze.

Our second example adopts a discrete Markov specification for the exogenous process

```{code-cell} python3
```{code-cell} ipython3
# == Parameters == #
β = 1 / 1.05
P = np.array([[0.8, 0.2, 0.0],
Expand Down Expand Up @@ -961,7 +962,7 @@ gen_fig_1(path)

The call `gen_fig_2(path)` generates

```{code-cell} python3
```{code-cell} ipython3
gen_fig_2(path)
```

Expand Down Expand Up @@ -997,7 +998,7 @@ Produce the corresponding figures.
:class: dropdown
```

```{code-cell} python3
```{code-cell} ipython3
# == Parameters == #
β = 1 / 1.05
ρ, mg = .95, .35
Expand All @@ -1023,10 +1024,11 @@ path = compute_paths(T, economy)
gen_fig_1(path)
```

```{code-cell} python3
```{code-cell} ipython3
gen_fig_2(path)
```

```{solution-end}
```


2 changes: 0 additions & 2 deletions lectures/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,5 @@ One way to give feedback is to raise an issue through our [issue tracker](https:
Please be as specific as possible. Tell us where the problem is and as much
detail about your local set up as you can provide.

Another feedback option is to use our [discourse forum](https://discourse.quantecon.org/).

Finally, you can provide direct feedback to [contact@quantecon.org](mailto:contact@quantecon.org)

Loading