Constant Elasticity of Variance (CEV) Model

class Cev(sigma, beta=0.5, intr=0.0, divr=0.0, is_fwd=False)[source]

Constant Elasticity of Variance (CEV) model.

Underlying price is assumed to follow CEV process: dS_t = (r - q) S_t dt + sigma S_t^beta dW_t, where dW_t is a standard Brownian motion.

Examples

>>> import numpy as np
>>> import pyfeng as pf
>>> m = pf.Cev(sigma=0.2, beta=0.5, intr=0.05, divr=0.1)
>>> m.price(np.arange(80, 121, 10), 100, 1.2)
array([16.11757214, 10.00786871,  5.64880408,  2.89028476,  1.34128656])
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

mass_zero(spot, texp, log=False)[source]

Probability mass absorbed at the zero boundary (K=0)

Parameters
  • spot – spot (or forward) price

  • texp – time to expiry

  • log – log value if True

Returns

(log) probability mass at zero

mass_zero_t0(spot, texp)[source]

Limit value of -T log(M_T) as T -> 0, where M_T is the mass at zero.

Parameters

spot – spot (or forward) price

Returns

  • lim_{T->0} T log(M_T)

params_kw()[source]

Model parameters in dictionary

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

CEV 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

  • beta – elasticity parameter

  • 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