Skip to content

[commod_price] Update editorial suggestions #443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
13 changes: 6 additions & 7 deletions lectures/commod_price.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ We will solve an equation where the price function is the unknown.

This is harder than solving an equation for an unknown number, or vector.

The lecture will discuss one way to solve a "functional equation" for an unknown
function
The lecture will discuss one way to solve a "functional equation" (the equation where the unknown object is a function).

For this lecture we need the `yfinance` library.

Expand Down Expand Up @@ -134,8 +133,7 @@ $p_t$.

The harvest of the commodity at time $t$ is $Z_t$.

We assume that the sequence $\{ Z_t \}_{t \geq 1}$ is IID with common
density function $\phi$.
We assume that the sequence $\{ Z_t \}_{t \geq 1}$ is {ref}`IID <lln_ksl>` with common density function $\phi$, where $\phi$ is nonnegative.

Speculators can store the commodity between periods, with $I_t$ units
purchased in the current period yielding $\alpha I_t$ units in the next.
Expand Down Expand Up @@ -193,12 +191,12 @@ Let $P := D^{-1}$ be the inverse demand function.

Regarding quantities,

* supply is the sum of carryover by speculators and the current harvest
* supply is the sum of carryover by speculators and the current harvest, and
* demand is the sum of purchases by consumers and purchases by speculators.

Mathematically,

* supply $ = X_t = \alpha I_{t-1} + Z_t$, which takes values in $S := \mathbb R_+$, while
* supply is given by $X_t = \alpha I_{t-1} + Z_t$, which takes values in $S := \mathbb R_+$, while
* demand $ = D(p_t) + I_t$

Thus, the market equilibrium condition is
Expand Down Expand Up @@ -347,7 +345,7 @@ The code below implements this iterative process, starting from $p_0 = P$.
The distribution $\phi$ is set to a shifted Beta distribution (although many
other choices are possible).

The integral in [](eq:dopf3) is computed via Monte Carlo.
The integral in [](eq:dopf3) is computed via {ref}`Monte Carlo <Monte-Carlo>`.


```{code-cell} ipython3
Expand Down Expand Up @@ -396,6 +394,7 @@ while error > tol:
ax.plot(grid, price, 'k-', alpha=0.5, lw=2, label=r'$p^*$')
ax.legend()
ax.set_xlabel('$x$', fontsize=12)
ax.set_ylabel('$prices$', fontsize=12)

plt.show()
```
Expand Down
2 changes: 1 addition & 1 deletion lectures/monte_carlo.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ from numpy.random import randn
```



(Monte-Carlo)=
## An introduction to Monte Carlo

In this section we describe how Monte Carlo can be used to compute
Expand Down