Skip to content

Add analytical delta to existing EquityPowerOption (positive powers only) - #400

Merged
domokane merged 5 commits into
domokane:masterfrom
AIM-IT4:feature/power-options-12
Oct 16, 2026
Merged

domokane merged 5 commits into
domokane:masterfrom
AIM-IT4:feature/power-options-12

Conversation

@AIM-IT4

@AIM-IT4 AIM-IT4 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Scope of the revised PR

FinancePy already implements power-option pricing in financepy/models/bs_power_option.py and EquityPowerOption. The original draft inadvertently replaced that existing API; that has been corrected. No duplicate pricer or replacement API remains.

New functionality: a JIT-compiled analytical spot delta for European power calls and puts, exposed through the existing EquityPowerOption.delta() method. Previously the inherited EquityOption.delta() used stock-price finite differences. The new closed-form derivative is phi * n * M_n / S * N(phi*d1) for n > 0, where M_n is the discounted n-th stock-price moment already used by the existing pricing function.

Response to maintainer feedback

  • Only strictly positive powers. Constructor rejects zero, negative, or non-finite power with FinError; the low-level model preserves FinancePy's existing NaN convention for non-positive powers.
  • Existing pricing preserved. Restored the upstream power_option_value(s,t,k,r,q,v,opt_type_value,n) function and its signature; existing equity product valuation and Monte Carlo pricing remain unchanged.
  • Precise added value. power_option_delta() in the existing model module, a product-level delta override, and a focused regression suite. No new PowerOption facade.

Verification

The new unit suite tests finite-difference agreement with the existing power-option pricer for fractional/integer positive powers, calls/puts, the n=1 Black–Scholes delta limit, quantity scaling, invalid powers and zero volatility. Finite-difference tolerances account for FinancePy's existing six-decimal approximate normcdf. 10 independent numerical formula checks passed; full repository unit/regression workflows are running on GitHub.

Related to #12 (analytical Greek enhancement to the existing product; no new FX product).

@domokane

Copy link
Copy Markdown
Owner

What is new here ? I don't want to allow negative and zero powers.

@AIM-IT4 AIM-IT4 changed the title Implement analytic European power option pricing and delta (#12) Add analytical delta to existing EquityPowerOption (positive powers only) Oct 15, 2026
@AIM-IT4

AIM-IT4 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for pointing this out. You are right: FinancePy already has power_option_value and EquityPowerOption, and the initial PR duplicated/replaced the existing implementation. I missed that.

I've revised this PR to preserve the existing pricing API and add only an analytical spot delta to the existing power-option model and EquityPowerOption.delta(). The current base-class delta is finite-difference based, so the new contribution is the closed-form Greek and its regression coverage.

I've also removed support for non-positive powers: EquityPowerOption now rejects n <= 0 (and non-finite values). Tests cover positive fractional/integer powers, both option types, the n=1 Black–Scholes limit, and comparisons against the existing pricer. Independent numerical checks pass; the updated GitHub CI is running.

Apologies for the duplicate implementation in the initial draft. Please let me know if analytical delta is a useful addition here, or if you'd prefer a different scope.

@domokane
domokane merged commit 8637064 into domokane:master Oct 16, 2026
2 checks passed
@domokane

Copy link
Copy Markdown
Owner

Thanks!

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