SVIVariance

class pfhedge.nn.SVIVariance(a, b, rho, m, sigma)[source]

Returns total variance in the SVI model.

The total variance for log strike \(k = \log(K / S)\), where \(K\) and \(S\) are strike and spot, reads:

\[w = a + b \left[ \rho (k - m) + \sqrt{(k - m)^2 + \sigma^2} \right] .\]

References

  • Jim Gatheral and Antoine Jacquier, Arbitrage-free SVI volatility surfaces. [arXiv:1204.0646 [q-fin.PR]]

Parameters

Examples

>>> import torch
>>>
>>> a, b, rho, m, sigma = 0.03, 0.10, 0.10, 0.00, 0.10
>>> module = SVIVariance(a, b, rho, m, sigma)
>>> input = torch.tensor([-0.10, -0.01, 0.00, 0.01, 0.10])
>>> module(input)
tensor([0.0431, 0.0399, 0.0400, 0.0401, 0.0451])