Bachelier (Normal) Model

Created on Tue Sep 19 22:56:58 2017 @author: jaehyuk

class Norm(sigma, intr=0.0, divr=0.0, is_fwd=False)[source]

Bachelier (normal) model for option pricing. Underlying price is assumed to follow arithmetic Brownian motion.

Examples

>>> import numpy as np
>>> import pyfeng as pf
>>> m = pf.Norm(sigma=20, intr=0.05, divr=0.1)
>>> m.price(np.arange(80, 121, 10), 100, 1.2)
array([16.57233446, 10.34711401,  5.77827026,  2.83857367,  1.20910477])
>>> sigma = np.array([20, 30, 50])[:, None]
>>> m = pf.Norm(sigma, intr=0.05, divr=0.1) # sigma in axis=0
>>> m.price(np.array([90, 100, 110]), 100, 1.2, cp=np.array([-1,1,1]))
array([[ 6.41387836,  5.77827026,  2.83857367],
       [10.48003559,  9.79822867,  6.3002881 ],
       [18.67164469, 17.95246828, 13.98027179]])
cdf(strike, spot, texp, cp=1)[source]

Cumulative distribution function of the final asset price.

Parameters
  • strike – strike price

  • spot – spot (or forward) price

  • texp – time to expiry

  • cp – -1 (default) for left-tail CDF, -1 for right-tail CDF (i.e., survival function)

Returns

CDF value

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

Option model delta (sensitivity to price).

Parameters
  • strike – strike price

  • spot – spot (or forward) price

  • texp – time to expiry

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

Returns

delta value

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

Option model gamma (2nd derivative to price).

Parameters
  • strike – strike price

  • spot – spot (or forward) price

  • texp – time to expiry

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

Returns

gamma value

impvol(price, strike, spot, texp, cp=1, setval=False)

Bachelier implied volatility by Choi et al. (2007)

Parameters
  • price – option price

  • strike – strike price

  • spot – spot (or forward) price

  • texp – time to expiry

  • cp – 1/-1 for call/put

  • setval – if True, sigma is set with the solved implied volatility

References

Choi, J., Kim, K., & Kwak, M. (2009). Numerical Approximation of the Implied Volatility Under Arithmetic Brownian Motion. Applied Mathematical Finance, 16(3), 261–268. https://doi.org/10.1080/13504860802583436

Returns

implied volatility

price_barrier(strike, barrier, spot, texp, cp=1, io=- 1)

Barrier option price under the BSM model

Parameters
  • strike – strike price

  • barrier – knock-in/out barrier price

  • spot – spot price

  • texp – time to expiry

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

  • io – +1 for knock-in, -1 for knock-out

Returns

Barrier option price

static price_formula(strike, spot, sigma, texp, cp=1, intr=0.0, divr=0.0, is_fwd=False)[source]

Bachelier model call/put option pricing formula (static method)

Parameters
  • strike – strike price

  • spot – spot (or forward)

  • sigma – model volatility

  • texp – time to expiry

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

  • sigma – model volatility

  • intr – interest rate (domestic interest rate)

  • divr – dividend/convenience yield (foreign interest rate)

  • is_fwd – if True, treat spot as forward price. False by default.

Returns

Vanilla option price

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

Option model theta (sensitivity to time-to-maturity).

Parameters
  • strike – strike price

  • spot – spot (or forward) price

  • texp – time to expiry

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

Returns

theta value

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

Option model vega (sensitivity to volatility).

Parameters
  • strike – strike price

  • spot – spot (or forward) price

  • texp – time to expiry

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

Returns

vega value

vol_smile(strike, spot, texp, cp=1, model='bsm')[source]

Equivalent volatility smile for a given model

Parameters
  • strike – strike price

  • spot – spot price

  • texp – time to expiry

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

  • model – {‘bsm’ (default), ‘bsm’, ‘bsm-approx’, ‘norm’}

Returns

volatility smile under the specified model