Skip to content

Allow negative rates and dividend yields in the finite difference pricer - #473

Open
Vaibhav1067 wants to merge 2 commits into
FinancePy-Org:masterfrom
Vaibhav1067:fix/fd-negative-rates
Open

Vaibhav1067 wants to merge 2 commits into
FinancePy-Org:masterfrom
Vaibhav1067:fix/fd-negative-rates

Conversation

@Vaibhav1067

Copy link
Copy Markdown

Problem

black_scholes_fd raises ValueError for any negative risk-free rate or dividend yield (validate_black_scholes_fd_inputs), so BlackScholesAlgorithmTypes.FINITE_DIFFERENCE cannot price European or American options in negative-rate markets (EUR, CHF and JPY rates were negative for years):

from financepy.models.bs_american_analytic import american_value, BlackScholesAlgorithmTypes
from financepy.utils.global_types import OptionTypes

american_value(100.0, 1.0, 100.0, -0.01, 0.02, 0.2, OptionTypes.AMERICAN_PUT,
               BlackScholesAlgorithmTypes.FINITE_DIFFERENCE)
# ValueError: risk_free_rate must be positive

This matters most for American options. The analytic approximations in bs_american_analytic.py return NaN for r < 0 or q < 0 (Bjerksund–Stensland notes it does not handle the negative-rate double-boundary regimes), so finite difference is the natural method to use there, but it is blocked.

Change

Remove the two sign checks. Nothing in the solver depends on the sign of r or q: the PDE discounts at r with drift (r - q) S on a log-spaced grid centred on spot, and American options are floored at the exercise value after every step. That projection also handles the case r < 0 < q, where an American call or put can have two exercise boundaries (Battauz, De Donno and Sbuelz, 2015), without any special treatment.

Validation

Over 162 cases with S in {70, 100, 130}, T in {0.25, 1, 3}, r in {-0.03, -0.005, 0.02}, q in {-0.02, 0, 0.03} and vol in {0.15, 0.4}, with the default grid:

Check Max abs error
European call/put FD vs analytic Black–Scholes 0.00013
American call FD vs 2001-step Leisen–Reimer 0.0119 (at a price of 39.88, 0.03%)
American put FD vs 2001-step Leisen–Reimer 0.0078

No American FD price fell below max(European, intrinsic).

Tests

Three new tests in tests/unit/test_model_finite_difference.py, in their own first commit; all 8 cases fail on master with the ValueError:

  • European calls and puts with negative r, negative q or both, against the analytic price.
  • An American put with r < 0 <= q, where early exercise is never optimal, against the European put. This is a model-free check.
  • An American call with r < 0 < q (double boundary) against a 2001-step Leisen–Reimer tree, and not below the European call.

Full unit suite: 1983 passed (1975 before plus the 8 new cases).

I used an AI assistant (Claude) to help find and write this change, and reviewed and validated it myself.

The new tests fail on master, where black_scholes_fd rejects a negative
risk-free rate or dividend yield.
black_scholes_fd raised ValueError for a negative risk-free rate or
dividend yield, so BlackScholesAlgorithmTypes.FINITE_DIFFERENCE could
not price options in negative-rate markets. Nothing in the theta scheme
depends on their sign: the PDE discounts at r with drift (r - q) S, and
American options are floored at the exercise value after each step,
which also covers the two exercise boundaries that negative rates can
create. Remove the two checks.

With the checks removed, European prices match the analytic formula to
1.3e-4, and American prices match a 2001-step Leisen-Reimer tree to
within 0.012 (0.03%) over 162 cases with r and q in [-0.03, 0.03].

This branch has not been deployed

No deployments
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.

1 participant