Skip to content

docs(features): clarify that gamma * S is intentional normalization (#33)#40

Open
bradsmithmba wants to merge 1 commit into
cloudtrainerwork:masterfrom
bradsmithmba:docs/gamma-normalization-clarify
Open

docs(features): clarify that gamma * S is intentional normalization (#33)#40
bradsmithmba wants to merge 1 commit into
cloudtrainerwork:masterfrom
bradsmithmba:docs/gamma-normalization-clarify

Conversation

@bradsmithmba

Copy link
Copy Markdown

Summary

Issue #33 (which I filed) flagged that calculate_gamma multiplies by S while calculate_theta/calculate_vega divide by S, and the gamma docstring's "normalized by underlying price" wording reads as if it should divide.

On investigation, the math is correct and the asymmetry is required. This PR is documentation-only — I'm correcting my own finding rather than the code.

Why gamma * S is right

The goal is price-scale-invariant features (comparable across underlyings of any price level):

  • raw Black-Scholes gamma scales as 1/S, so gamma * S removes the price dependence
  • raw theta and vega scale as S, so theta / S and vega / S remove it

Different raw scalings require opposite operations to reach the same normalization.

Verification

At equal moneyness/vol/time, the normalized values are identical across price levels:

S=100 : gamma*S=3.92880  theta/S=-0.000287  vega/S/100=0.001964
S=1000: gamma*S=3.92880  theta/S=-0.000287  vega/S/100=0.001964

Changing gamma to gamma / S would reintroduce price dependence — a real bug. So the only change here is to reword the docstring/comment to explain the reasoning and warn against "fixing" it.

Change

  • Docstring return description and inline comment updated to state that * S is intentional and why.
  • No behavior change.

Closes #33.

🤖 Generated with Claude Code

Issue cloudtrainerwork#33 flagged that calculate_gamma multiplies by S while calculate_theta
and calculate_vega divide by S, and the gamma docstring's "normalized by
underlying price" wording reads as if it should divide. On investigation the
math is correct and the asymmetry is required:

- raw gamma scales as 1/S, so gamma * S is price-scale-invariant
- raw theta and vega scale as S, so theta/S and vega/S are price-scale-invariant

Verified empirically: gamma*S, theta/S, vega/S/100 are identical for S=100
and S=1000 at equal moneyness/vol/time. Changing gamma to gamma / S would
REINTRODUCE price dependence (a real bug), so this is a documentation-only
change: reword the docstring and comment to explain why the *S is correct and
warn against "fixing" it.

No behavior change.

Closes cloudtrainerwork#33

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

calculate_gamma scales by *S while theta/vega scale by /S — normalization inconsistency

1 participant