Skip to content

Conversation

@jstac
Copy link
Contributor

@jstac jstac commented Mar 3, 2023

Addresses #76

TODO

  • Proofread
  • use correct exercise / solution environment
  • consider adding one more exercise (maybe merge this first and then open a new issue)

@netlify
Copy link

netlify bot commented Mar 3, 2023

Deploy Preview for taupe-gaufre-c4e660 ready!

Name Link
🔨 Latest commit 51ea510
🔍 Latest deploy log https://app.netlify.com/sites/taupe-gaufre-c4e660/deploys/64054b4f7454ac00088a78d9
😎 Deploy Preview https://deploy-preview-115--taupe-gaufre-c4e660.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@jstac jstac requested review from maanasee and shlff March 3, 2023 02:11
@mmcky
Copy link
Contributor

mmcky commented Mar 3, 2023

  • This lecture needs to be added to the _toc.yml
/home/runner/work/lecture-python-intro/lecture-python-intro/lectures/monte_carlo.md: WARNING: document isn't included in any toctree

Copy link
Member

@shlff shlff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for writing such a beautiful and valuable lecture @jstac . I've learned a lot from it.

I've included my reviews below.

PS. A possible new exercise could be added where we introduce the more realistic distributional dynamics for the option price with the persistence and transitory parameters. We could ask students to investigate how the changes in these parameters could affect the distributional dynamics and therefore the option price.

Suppose that, after analyzing the data, we guess that $S$ is well
represented by a lognormal distribution with parameters $\mu, \sigma$ .

* $S$ has the same distribution as $\exp(\mu + \sigma Z)$ where $Z$ is standard normal.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe change where $Z$ is standard normal. -> where $Z$ is standard normal $N(\mu, \sigma)$.

* $S$ has the same distribution as $\exp(\mu + \sigma Z)$ where $Z$ is standard normal.
* we write this statement as $S \sim LN(\mu, \sigma)$.

Any good reference on statistics (such as
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably statistics -> lognormal distribution.

* we write this statement as $S \sim LN(\mu, \sigma)$.

Any good reference on statistics (such as
[Wikipedia](https://en.wikipedia.org/wiki/Log-normal_distribution)) will tell
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Wikipedia] --> [the one from Wikipedia]?


$$
\mathop{\mathrm{Var}} S
= [\exp(\sigma^2) - 1] \exp(2\mu + \sigma^2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a full stop . at the end.


But now suppose that we study the distribution of $S$ more carefully.

We decide that the share price depends on three variables, $X_1$, $X_2, and $X_3$ (for example, sales, inflation, etc.).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$X_2, -> $X_2$,

Maybe add interest rates to the variable series sales, inflation, since we mentioned 3 variables before.

Now that our model is more complicated, we cannot easily determine the
distribution of $S_n$.

So to compute the price $P_0$ of the option, we use Monte Carlo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • $P_0$ -> $P$
  • add . at the end

So to compute the price $P_0$ of the option, we use Monte Carlo


WE average over realizations $S_n^1, \ldots, S_n^M$ of $S_n$ and appealing to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • WE -> We
  • appealing -> appeal




## ExerciseS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

## ExerciseS -> ## Exercises

s = np.full(M, np.log(S0))
h = np.full(M, h0)
for t in range(n):
Z = np.random.randn((2, M))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Z = np.random.randn((2, M)) -> Z = np.random.randn(2, M)


Notice that this version is faster than the one using a Python loop.

Now let's try with larger $M$ to get a more accurate calculation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with larger $M$ -> with a larger $M$

@shlff
Copy link
Member

shlff commented Mar 6, 2023

The commit above updates the exercise and solution environment to exercise 1.

@jstac
Copy link
Contributor Author

jstac commented Mar 6, 2023

Many thanks @shlff !

I appreciate your careful reading. I've made some of those changes in a9ccf3

@jstac
Copy link
Contributor Author

jstac commented Mar 6, 2023

Added to toc in 51ea510

@github-actions github-actions bot temporarily deployed to commit March 6, 2023 02:23 Inactive
@jstac jstac merged commit 36de852 into main Mar 6, 2023
@jstac jstac deleted the add_monte branch March 6, 2023 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants