Hyperbolic Normal Stochastic Volatility (NSVh) Model

class Nsvh1(sigma, vov=0.0, rho=0.0, beta=None, intr=0.0, divr=0.0, is_fwd=False, is_atmvol=False)[source]

Hyperbolic Normal Stochastic Volatility (NSVh) model with lambda=1 by Choi et al. (2019)

References

Examples

>>> import numpy as np
>>> import pyfeng as pf
>>> m = pf.Nsvh1(sigma=20, vov=0.8, rho=-0.3)
>>> m.price(np.arange(80, 121, 10), 100, 1.2)
array([25.51200027, 17.87539874, 11.47308947,  6.75128331,  3.79464422])
calibrate_vsk(var, skew, exkurt, texp=1, setval=False)[source]

Calibrate parameters to the moments: variance, skewness, ex-kurtosis.

Parameters
  • texp – time-to-expiry

  • var – variance

  • skew – skewness

  • exkurt – ex-kurtosis. should be > 0.

Returns: (sigma, vov, rho)

References

Tuenter, H. J. H. (2001). An algorithm to determine the parameters of SU-curves in the johnson system of probabillity distributions by moment matching. Journal of Statistical Computation and Simulation, 70(4), 325–347. https://doi.org/10.1080/00949650108812126

moments_vsk(texp=1)[source]

Variance, skewness, and ex-kurtosis

Parameters

texp – time-to-expiry

Returns

(variance, skewness, and ex-kurtosis)

price(strike, spot, texp, cp=1)[source]

Call/put option price.

Parameters
  • strike – strike price.

  • spot – spot (or forward) price.

  • texp – time to expiry.

  • cp – 1/-1 for call/put option.

Returns

option price

class NsvhMc(sigma, vov=0.0, rho=0.0, lam=0.0, beta=None, intr=0.0, divr=0.0, is_fwd=False)[source]

Monte-Carlo model of Hyperbolic Normal Stochastic Volatility (NSVh) model.

NSVh with lambda = 0 is the normal SABR model, and NSVh with lambda = 1 has analytic pricing (Nsvh1)

References

See also

Nsvh1

Examples

>>> import numpy as np
>>> import pyfeng as pf
>>> m = pf.NsvhMc(sigma=20, vov=0.8, rho=-0.3, lam=0.0)
>>> m.price(np.arange(80, 121, 10), 100, 1.2)
array([23.52722081, 15.63212633,  9.19644639,  4.81061848,  2.39085097])
>>> m1 = pf.NsvhMc(sigma=20, vov=0.8, rho=-0.3, lam=1.0)
>>> m2 = pf.Nsvh1(sigma=20, vov=0.8, rho=-0.3)
>>> p1 = m1.price(np.arange(80, 121, 10), 100, 1.2)
>>> p2 = m2.price(np.arange(80, 121, 10), 100, 1.2)
>>> p1 - p2
array([-0.00328887,  0.00523714,  0.00808885,  0.0069694 ,  0.00205566])
mc_vol_price(texp)[source]

Simulate volatility and price pair

Parameters

texp – time-to-expiry

Returns: (vol, price). vol: (n_path, ), price: (n_path, 2)

price(strike, spot, texp, cp=1)[source]

Vanilla option price from MC simulation of NSVh model.

Parameters
  • strike – strike price

  • spot – spot price

  • texp – time to np.expiry

  • cp – 1/-1 for call/put

Returns

vanilla option price

class NsvhQuadInt(sigma, vov=0.0, rho=0.0, lam=0.0, beta=None, intr=0.0, divr=0.0, is_fwd=False)[source]

Quadrature integration method of Hyperbolic Normal Stochastic Volatility (NSVh) model.

NSVh with lambda = 0 is the normal SABR model, and NSVh with lambda = 1 has analytic pricing (Nsvh1)

References

See also

Nsvh1, SabrNormalVolApprox

Examples

>>> import numpy as np
>>> import pyfeng as pf
>>> #### Nsvh1: comparison with analytic pricing
>>> m1 = pf.NsvhQuadInt(sigma=20, vov=0.8, rho=-0.3, lam=1.0)
>>> m2 = pf.Nsvh1(sigma=20, vov=0.8, rho=-0.3)
>>> p1 = m1.price(np.arange(80, 121, 10), 100, 1.2)
>>> p2 = m2.price(np.arange(80, 121, 10), 100, 1.2)
>>> p1 - p2
array([0.00345526, 0.00630649, 0.00966333, 0.00571175, 0.00017924])
>>> #### Normal SABR: comparison with vol approximation
>>> m1 = pf.NsvhQuadInt(sigma=20, vov=0.8, rho=-0.3, lam=0.0)
>>> m2 = pf.SabrNormVolApprox(sigma=20, vov=0.8, rho=-0.3)
>>> p1 = m1.price(np.arange(80, 121, 10), 100, 1.2)
>>> p2 = m2.price(np.arange(80, 121, 10), 100, 1.2)
>>> p1 - p2
array([-0.17262802, -0.10160687, -0.00802731,  0.0338126 ,  0.01598512])

References

Choi J (2023), Unpublished Working Paper.

price(strike, spot, texp, cp=1)[source]

Call/put option price.

Parameters
  • strike – strike price.

  • spot – spot (or forward) price.

  • texp – time to expiry.

  • cp – 1/-1 for call/put option.

Returns

option price