Skip to content
All library documents

Numerical Sensitivity of Discrete Sums with Continuous Limits

Article Quant Q&A · Author: capea

Summary

The document frames a numerical problem from quantitative finance: differentiating a discrete sum with respect to a continuous upper limit to estimate first- and second-order sensitivities. It gives an exponentially decaying summand with a fractional-power term as an example, and evaluates the challenge in settings such as discretely monitored derivatives and variance swaps.

It compares finite differences, Euler–Maclaurin expansion, analytic continuation using zeta-related functions, and replacing the sum with an integral plus corrections. The author reports that interpolation and second differences can be noisy, higher derivatives become unwieldy, and the cited analytic continuation does not fit the mixed summand. No accepted solution, numerical results, or references are provided; the text is a request for practitioner methods and production precision, so it establishes a problem and candidate limitations rather than a validated approach.

Key ideas

  • The target is a derivative of a discrete sum after extending its upper limit continuously.
  • Finite differences depend on defining non-integer values and may amplify numerical noise in second derivatives.
  • Euler–Maclaurin corrections can become difficult when the summand has fractional-power structure.
  • The document proposes no final method or precision benchmark, leaving the practical question open.

Tags

Full text
# How to compute derivatives of discrete sums with respect to continuous upper limit for sensitivity analysis?


# How to compute derivatives of discrete sums with respect to continuous upper limit for sensitivity analysis?












In several quantitative finance contexts (discrete Asian options, credit derivatives, variance swaps with discrete monitoring), we encounter sums of the form:

$$S(n) = \sum_{k=1}^{n} f(k)$$

where $f(k)$ has no closed-form antidifference.

For sensitivity analysis (Greeks), I need to compute derivatives treating the upper limit as continuous:

$$\frac{\partial S}{\partial x}\bigg|_{x=n}, \quad \frac{\partial^2 S}{\partial x^2}\bigg|_{x=n}$$

Concrete example (from stochastic volatility context):

$$S(x) = \sum_{k=1}^{x} e^{-rk - b k^{3/2}}$$

with $r = 0.05$, $b = 0.1$, evaluated at $x = 10^6$.

What I have tried:

- Finite differences:

$$\frac{dS}{dx} \approx \frac{S(n+h) - S(n-h)}{2h}$$

$$\frac{d^2S}{dx^2} \approx \frac{S(n+h) - 2S(n) + S(n-h)}{h^2}$$

Problem: This requires extending to non-integer $n$. I tried interpolating $S(n)$ but second derivatives accumulate significant numerical noise, especially for large $n$.

- Euler-Maclaurin formula:

$$\sum_{k=1}^{n} f(k) \approx \int_1^n f(x)dx + \frac{f(1)+f(n)}{2} + \sum_{j=1}^{p} \frac{B_{2j}}{(2j)!}\left(f^{(2j-1)}(n) - f^{(2j-1)}(1)\right)$$

Problem: For $f(k) = e^{-rk - bk^{3/2}}$, the higher derivatives become increasingly complex, and the asymptotic expansion does not converge well due to the $k^{3/2}$ term.

- Analytic continuation via Lerch/Hurwitz zeta:

$$\Phi(z,s,a) = \sum_{k=0}^{\infty} \frac{z^k}{(k+a)^s}$$

Problem: Not applicable when $f(k)$ mixes exponential decay with fractional powers $k^{3/2}$.

- Direct numerical integration of the "summand density":

Tried replacing the sum with:

$$S(x) \approx \int_1^x f(t) dt + \text{correction terms}$$

Problem: The correction terms for non-integer limits are not straightforward to compute with high precision.

My questions:

- What numerical methods do practitioners use for computing such "fractional Greeks" when no closed form exists?

- Is there established literature on extending discrete sums to continuous limits for sensitivity calculations?

- For large $n$ (e.g., $10^6$ terms in HFT or risk systems), what precision is typically achievable in production?

Any references to papers or production implementations would be appreciated.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.