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
a (torch.Tensor or float) – The parameter \(a\).
b (torch.Tensor or float) – The parameter \(b\).
rho (torch.Tensor or float) – The parameter \(\rho\).
m (torch.Tensor or float) – The parameter \(m\).
sigma (torch.Tensor or float) – The parameter \(\sigma\).
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])