Skip to content

Conversation

@jstac
Copy link
Contributor

@jstac jstac commented Nov 22, 2025

Summary

This PR resolves a notation conflict in the stochastic cake eating lecture where the variable s was being used for both:

  • Savings: s = x - c
  • Volatility (shock scale parameter) in the production shock: ξ := exp(μ + s ζ)

The volatility parameter has been changed to ν (Greek letter nu) throughout both the mathematical text and Python code.

Changes

  • Updated mathematical notation in LaTeX expressions from s to \nu
  • Changed Model NamedTuple field from s: float to ν: float
  • Updated create_model function parameter from s to ν
  • Modified shock calculation to use ν: shocks = np.exp(μ + ν * np.random.randn(shock_size))
  • Simplified Model instantiation from keyword arguments to positional arguments for cleaner code

Test plan

  • Converted markdown to Python using jupytext
  • Ran the Python script successfully
  • Both test cases converged without errors (log utility in 229 iterations, CRRA utility in 237 iterations)

🤖 Generated with Claude Code

Changed the shock scale parameter from 's' to 'ν' (Greek letter nu) to
resolve the naming conflict with savings (s = x - c). This makes the code
more readable and consistent with mathematical notation conventions.

Changes:
- Updated mathematical notation in text to use \nu instead of s
- Changed Model NamedTuple field from 's' to 'ν'
- Updated create_model function parameter from 's' to 'ν'
- Modified shock calculation to use ν
- Simplified Model instantiation to use positional arguments

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@jstac
Copy link
Contributor Author

jstac commented Nov 22, 2025

This change improves code clarity by eliminating the confusing dual use of the variable 's'. Now 's' is used exclusively for savings (s = x - c), and 'ν' (nu) is used for the volatility parameter in the shock distribution. The Greek letter ν is a natural choice that aligns with common mathematical conventions for volatility parameters.

@github-actions
Copy link

📖 Netlify Preview Ready!

Preview URL: https://pr-728--sunny-cactus-210e3e.netlify.app (5bbd1d4)

📚 Changed Lecture Pages: cake_eating_stochastic

@jstac jstac merged commit d8c1bec into main Nov 22, 2025
1 check passed
@jstac jstac deleted the cake_og branch November 22, 2025 21:28
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.

2 participants