public class AnalyticFormulas extends Object
Modifier and Type | Method and Description |
---|---|
static double |
bachelierGeneralizedOptionVega(double forward,
double volatility,
double optionMaturity,
double optionStrike,
double payoffUnit)
Calculates the vega of a call, i.e., the payoff max(S(T)-K,0) P, where S follows a
normal process with constant volatility, i.e., a Bachelier model
\[
\mathrm{d} S(t) = r S(t) \mathrm{d} t + \sigma \mathrm{d}W(t)
\]
|
static double |
bachelierOptionDelta(double forward,
double volatility,
double optionMaturity,
double optionStrike,
double payoffUnit)
Calculates the option delta of a call, i.e., the payoff max(S(T)-K,0), where S follows a
normal process with constant volatility, i.e., a Bachelier model
\[
\mathrm{d} S(t) = r S(t) \mathrm{d} t + \sigma \mathrm{d}W(t)
\]
|
static double |
bachelierOptionImpliedVolatility(double forward,
double optionMaturity,
double optionStrike,
double payoffUnit,
double optionValue)
Calculates the Bachelier option implied volatility of a call, i.e., the payoff
max(S(T)-K,0), where S follows a normal process with constant volatility.
|
static double |
bachelierOptionValue(double forward,
double volatility,
double optionMaturity,
double optionStrike,
double payoffUnit)
Calculates the option value of a call, i.e., the payoff max(S(T)-K,0), where S follows a
normal process with constant volatility, i.e., a Bachelier model
\[
\mathrm{d} S(t) = r S(t) \mathrm{d} t + \sigma \mathrm{d}W(t)
\]
|
static RandomVariable |
bachelierOptionValue(RandomVariable forward,
RandomVariable volatility,
double optionMaturity,
double optionStrike,
RandomVariable payoffUnit)
Calculates the option value of a call, i.e., the payoff max(S(T)-K,0) P, where S follows a
normal process with constant volatility, i.e., a Bachelier model
\[
\mathrm{d} S(t) = r S(t) \mathrm{d} t + \sigma \mathrm{d}W(t)
\]
|
static double |
blackModelCapletValue(double forward,
double volatility,
double optionMaturity,
double optionStrike,
double periodLength,
double discountFactor)
Calculate the value of a caplet assuming the Black'76 model.
|
static double |
blackModelDgitialCapletValue(double forward,
double volatility,
double periodLength,
double discountFactor,
double optionMaturity,
double optionStrike)
Calculate the value of a digital caplet assuming the Black'76 model.
|
static double |
blackModelSwaptionValue(double forwardSwaprate,
double volatility,
double optionMaturity,
double optionStrike,
double swapAnnuity)
Calculate the value of a swaption assuming the Black'76 model.
|
static double |
blackScholesATMOptionValue(double volatility,
double optionMaturity,
double forward,
double payoffUnit)
Calculates the Black-Scholes option value of an atm call option.
|
static double |
blackScholesDigitalOptionDelta(double initialStockValue,
double riskFreeRate,
double volatility,
double optionMaturity,
double optionStrike)
Calculates the delta of a digital option under a Black-Scholes model
|
static double |
blackScholesDigitalOptionRho(double initialStockValue,
double riskFreeRate,
double volatility,
double optionMaturity,
double optionStrike)
Calculates the rho of a digital option under a Black-Scholes model
|
static double |
blackScholesDigitalOptionValue(double initialStockValue,
double riskFreeRate,
double volatility,
double optionMaturity,
double optionStrike)
Calculates the Black-Scholes option value of a digital call option.
|
static double |
blackScholesDigitalOptionVega(double initialStockValue,
double riskFreeRate,
double volatility,
double optionMaturity,
double optionStrike)
Calculates the vega of a digital option under a Black-Scholes model
|
static double |
blackScholesGeneralizedOptionValue(double forward,
double volatility,
double optionMaturity,
double optionStrike,
double payoffUnit)
Calculates the Black-Scholes option value of a call, i.e., the payoff max(S(T)-K,0) P, where S follows a log-normal process with constant log-volatility.
|
static RandomVariable |
blackScholesGeneralizedOptionValue(RandomVariable forward,
RandomVariable volatility,
double optionMaturity,
double optionStrike,
RandomVariable payoffUnit)
Calculates the Black-Scholes option value of a call, i.e., the payoff max(S(T)-K,0) P, where S follows a log-normal process with constant log-volatility.
|
static double |
blackScholesGeneralizedOptionVega(double forward,
double volatility,
double optionMaturity,
double optionStrike,
double payoffUnit)
Calculates the vega of a call, i.e., the payoff max(S(T)-K,0) P, where S follows a
normal process with constant volatility, i.e., a Black-Scholes model
\[
\mathrm{d} S(t) = r S(t) \mathrm{d} t + \sigma S(t)\mathrm{d}W(t)
\]
|
static double |
blackScholesOptionDelta(double initialStockValue,
double riskFreeRate,
double volatility,
double optionMaturity,
double optionStrike)
Calculates the delta of a call option under a Black-Scholes model
The method also handles cases where the forward and/or option strike is negative
and some limit cases where the forward or the option strike is zero.
|
static RandomVariable |
blackScholesOptionDelta(RandomVariable initialStockValue,
RandomVariable riskFreeRate,
RandomVariable volatility,
double optionMaturity,
double optionStrike)
Calculates the delta of a call option under a Black-Scholes model
The method also handles cases where the forward and/or option strike is negative
and some limit cases where the forward or the option strike is zero.
|
static RandomVariable |
blackScholesOptionDelta(RandomVariable initialStockValue,
RandomVariable riskFreeRate,
RandomVariable volatility,
double optionMaturity,
RandomVariable optionStrike)
Calculates the delta of a call option under a Black-Scholes model
The method also handles cases where the forward and/or option strike is negative
and some limit cases where the forward or the option strike is zero.
|
static double |
blackScholesOptionGamma(double initialStockValue,
double riskFreeRate,
double volatility,
double optionMaturity,
double optionStrike)
This static method calculated the gamma of a call option under a Black-Scholes model
|
static RandomVariable |
blackScholesOptionGamma(RandomVariable initialStockValue,
RandomVariable riskFreeRate,
RandomVariable volatility,
double optionMaturity,
double optionStrike)
This static method calculated the gamma of a call option under a Black-Scholes model
|
static double |
blackScholesOptionImpliedVolatility(double forward,
double optionMaturity,
double optionStrike,
double payoffUnit,
double optionValue)
Calculates the Black-Scholes option implied volatility of a call, i.e., the payoff
max(S(T)-K,0), where S follows a log-normal process with constant log-volatility.
|
static double |
blackScholesOptionRho(double initialStockValue,
double riskFreeRate,
double volatility,
double optionMaturity,
double optionStrike)
This static method calculated the rho of a call option under a Black-Scholes model
|
static double |
blackScholesOptionTheta(double initialStockValue,
double riskFreeRate,
double volatility,
double optionMaturity,
double optionStrike)
This static method calculated the vega of a call option under a Black-Scholes model
|
static double |
blackScholesOptionValue(double initialStockValue,
double riskFreeRate,
double volatility,
double optionMaturity,
double optionStrike)
Calculates the Black-Scholes option value of a call, i.e., the payoff max(S(T)-K,0), where S follows a log-normal process with constant log-volatility.
|
static double |
blackScholesOptionValue(double initialStockValue,
double riskFreeRate,
double volatility,
double optionMaturity,
double optionStrike,
boolean isCall)
Calculates the Black-Scholes option value of a call, i.e., the payoff max(S(T)-K,0), or a put, i.e., the payoff max(K-S(T),0), where S follows a log-normal process with constant log-volatility.
|
static double |
blackScholesOptionVega(double initialStockValue,
double riskFreeRate,
double volatility,
double optionMaturity,
double optionStrike)
Calculates the vega of a call, i.e., the payoff max(S(T)-K,0) P, where S follows a
normal process with constant volatility, i.e., a Black-Scholes model
\[
\mathrm{d} S(t) = r S(t) \mathrm{d} t + \sigma S(t)\mathrm{d}W(t)
\]
|
static double |
huntKennedyCMSAdjustedRate(double forwardSwaprate,
double volatility,
double swapAnnuity,
double optionMaturity,
double swapMaturity,
double payoffUnit)
Calculate the adjusted forward swaprate corresponding to a change of payoff unit from the given swapAnnuity to the given payoffUnit
using the Black-Scholes model for the swap rate together with the Hunt-Kennedy convexity adjustment.
|
static double |
huntKennedyCMSFloorValue(double forwardSwaprate,
double volatility,
double swapAnnuity,
double optionMaturity,
double swapMaturity,
double payoffUnit,
double optionStrike)
Calculate the value of a CMS strike using the Black-Scholes model for the swap rate together with
the Hunt-Kennedy convexity adjustment.
|
static double |
huntKennedyCMSOptionValue(double forwardSwaprate,
double volatility,
double swapAnnuity,
double optionMaturity,
double swapMaturity,
double payoffUnit,
double optionStrike)
Calculate the value of a CMS option using the Black-Scholes model for the swap rate together with
the Hunt-Kennedy convexity adjustment.
|
static double |
margrabeExchangeOptionValue(double spot1,
double spot2,
double volatility1,
double volatility2,
double correlation,
double optionMaturity)
Calculates the value of an Exchange option under a generalized Black-Scholes model, i.e., the payoff \( max(S_{1}(T)-S_{2}(T),0) \),
where \( S_{1} \) and \( S_{2} \) follow a log-normal process with constant log-volatility and constant instantaneous correlation.
|
static double |
price(Date settlementDate,
Date maturityDate,
double coupon,
double yield,
double redemption,
int frequency)
Re-implementation of the Excel PRICE function (a rather primitive bond price formula).
|
static double |
price(double timeToMaturity,
double coupon,
double yield,
double redemption,
int frequency)
Re-implementation of the Excel PRICE function (a rather primitive bond price formula).
|
static double |
sabrAlphaApproximation(double normalVolatility,
double beta,
double rho,
double nu,
double displacement,
double underlying,
double maturity)
Return the parameter alpha (initial value of the stochastic vol process) of a SABR model using the
to match the given at-the-money volatility.
|
static double |
sabrBerestyckiNormalVolatilityApproximation(double alpha,
double beta,
double rho,
double nu,
double displacement,
double underlying,
double strike,
double maturity)
Return the implied normal volatility (Bachelier volatility) under a SABR model using the
approximation of Berestycki.
|
static double |
sabrHaganLognormalBlackVolatilityApproximation(double alpha,
double beta,
double rho,
double nu,
double underlying,
double strike,
double maturity)
Calculated the approximation to the lognormal Black volatility using the
standard SABR model and the standard Hagan approximation.
|
static double |
sabrHaganLognormalBlackVolatilityApproximation(double alpha,
double beta,
double rho,
double nu,
double displacement,
double underlying,
double strike,
double maturity)
Calculated the approximation to the lognormal Black volatility using the
standard SABR model and the standard Hagan approximation.
|
static double |
sabrNormalVolatilityApproximation(double alpha,
double beta,
double rho,
double nu,
double displacement,
double underlying,
double strike,
double maturity)
Return the implied normal volatility (Bachelier volatility) under a SABR model using the
approximation of Hagan.
|
static double |
sabrNormalVolatilityCurvatureApproximation(double alpha,
double beta,
double rho,
double nu,
double displacement,
double underlying,
double maturity)
Return the curvature of the implied normal volatility (Bachelier volatility) under a SABR model using the
approximation of Berestycki.
|
static double |
sabrNormalVolatilitySkewApproximation(double alpha,
double beta,
double rho,
double nu,
double displacement,
double underlying,
double maturity)
Return the skew of the implied normal volatility (Bachelier volatility) under a SABR model using the
approximation of Berestycki.
|
static double |
volatilityConversionLognormalATMtoNormalATM(double forward,
double displacement,
double maturity,
double lognormalVolatiltiy)
Exact conversion of displaced lognormal ATM volatiltiy to normal ATM volatility.
|
public static double blackScholesGeneralizedOptionValue(double forward, double volatility, double optionMaturity, double optionStrike, double payoffUnit)
forward
- The forward of the underlying.volatility
- The Black-Scholes volatility.optionMaturity
- The option maturity T.optionStrike
- The option strike. If the option strike is ≤ 0.0 the method returns the value of the forward contract paying S(T)-K in T.payoffUnit
- The payoff unit (e.g., the discount factor)public static RandomVariable blackScholesGeneralizedOptionValue(RandomVariable forward, RandomVariable volatility, double optionMaturity, double optionStrike, RandomVariable payoffUnit)
forward
- The forward of the underlying.volatility
- The Black-Scholes volatility.optionMaturity
- The option maturity T.optionStrike
- The option strike. If the option strike is ≤ 0.0 the method returns the value of the forward contract paying S(T)-K in T.payoffUnit
- The payoff unit (e.g., the discount factor)public static double blackScholesOptionValue(double initialStockValue, double riskFreeRate, double volatility, double optionMaturity, double optionStrike)
initialStockValue
- The spot value of the underlying.riskFreeRate
- The risk free rate r (df = exp(-r T)).volatility
- The Black-Scholes volatility.optionMaturity
- The option maturity T.optionStrike
- The option strike. If the option strike is ≤ 0.0 the method returns the value of the forward contract paying S(T)-K in T.public static double blackScholesOptionValue(double initialStockValue, double riskFreeRate, double volatility, double optionMaturity, double optionStrike, boolean isCall)
initialStockValue
- The spot value of the underlying.riskFreeRate
- The risk free rate r (df = exp(-r T)).volatility
- The Black-Scholes volatility.optionMaturity
- The option maturity T.optionStrike
- The option strike. If the option strike is ≤ 0.0 the method returns the value of the forward contract paying S(T)-K in T for the call and zero for the put.isCall
- If true, the value of a call is calculated, if false, the value of a put is calculated.public static double blackScholesATMOptionValue(double volatility, double optionMaturity, double forward, double payoffUnit)
volatility
- The Black-Scholes volatility.optionMaturity
- The option maturity T.forward
- The forward, i.e., the expectation of the index under the measure associated with payoff unit.payoffUnit
- The payoff unit, i.e., the discount factor or the anuity associated with the payoff.public static double blackScholesOptionDelta(double initialStockValue, double riskFreeRate, double volatility, double optionMaturity, double optionStrike)
initialStockValue
- The initial value of the underlying, i.e., the spot.riskFreeRate
- The risk free rate of the bank account numerarie.volatility
- The Black-Scholes volatility.optionMaturity
- The option maturity T.optionStrike
- The option strike.public static RandomVariable blackScholesOptionDelta(RandomVariable initialStockValue, RandomVariable riskFreeRate, RandomVariable volatility, double optionMaturity, double optionStrike)
initialStockValue
- The initial value of the underlying, i.e., the spot.riskFreeRate
- The risk free rate of the bank account numerarie.volatility
- The Black-Scholes volatility.optionMaturity
- The option maturity T.optionStrike
- The option strike.public static RandomVariable blackScholesOptionDelta(RandomVariable initialStockValue, RandomVariable riskFreeRate, RandomVariable volatility, double optionMaturity, RandomVariable optionStrike)
initialStockValue
- The initial value of the underlying, i.e., the spot.riskFreeRate
- The risk free rate of the bank account numerarie.volatility
- The Black-Scholes volatility.optionMaturity
- The option maturity T.optionStrike
- The option strike.public static double blackScholesOptionGamma(double initialStockValue, double riskFreeRate, double volatility, double optionMaturity, double optionStrike)
initialStockValue
- The initial value of the underlying, i.e., the spot.riskFreeRate
- The risk free rate of the bank account numerarie.volatility
- The Black-Scholes volatility.optionMaturity
- The option maturity T.optionStrike
- The option strike.public static RandomVariable blackScholesOptionGamma(RandomVariable initialStockValue, RandomVariable riskFreeRate, RandomVariable volatility, double optionMaturity, double optionStrike)
initialStockValue
- The initial value of the underlying, i.e., the spot.riskFreeRate
- The risk free rate of the bank account numerarie.volatility
- The Black-Scholes volatility.optionMaturity
- The option maturity T.optionStrike
- The option strike.public static double blackScholesOptionVega(double initialStockValue, double riskFreeRate, double volatility, double optionMaturity, double optionStrike)
initialStockValue
- The initial value of the underlying, i.e., the spot.riskFreeRate
- The risk free rate of the bank account numerarie.volatility
- The Black-Scholes volatility.optionMaturity
- The option maturity T.optionStrike
- The option strike.public static double blackScholesOptionTheta(double initialStockValue, double riskFreeRate, double volatility, double optionMaturity, double optionStrike)
initialStockValue
- The initial value of the underlying, i.e., the spot.riskFreeRate
- The risk free rate of the bank account numerarie.volatility
- The Black-Scholes volatility.optionMaturity
- The option maturity T.optionStrike
- The option strike.public static double blackScholesOptionRho(double initialStockValue, double riskFreeRate, double volatility, double optionMaturity, double optionStrike)
initialStockValue
- The initial value of the underlying, i.e., the spot.riskFreeRate
- The risk free rate of the bank account numerarie.volatility
- The Black-Scholes volatility.optionMaturity
- The option maturity T.optionStrike
- The option strike.public static double blackScholesOptionImpliedVolatility(double forward, double optionMaturity, double optionStrike, double payoffUnit, double optionValue)
max(S(T)-K,0)
, where S follows a log-normal process with constant log-volatility. The admissible values foroptionValue
are between forward * payoffUnit - optionStrike
(the inner value) and forward * payoffUnit
.forward
- The forward of the underlying (which is equal to S(0) / payoffUnit, given the spot value S(0)).optionMaturity
- The option maturity T.optionStrike
- The option strike. If the option strike is ≤ 0.0 the method returns the value of the forward contract paying S(T)-K in T.payoffUnit
- The payoff unit (e.g., the discount factor), (which is equal to exp(-maturity * r), given the interest rate r).optionValue
- The option value. The admissible values for optionValue
are between forward * payoffUnit - optionStrike
(the inner value) and forward * payoffUnit
.public static double blackScholesDigitalOptionValue(double initialStockValue, double riskFreeRate, double volatility, double optionMaturity, double optionStrike)
initialStockValue
- The initial value of the underlying, i.e., the spot.riskFreeRate
- The risk free rate of the bank account numerarie.volatility
- The Black-Scholes volatility.optionMaturity
- The option maturity T.optionStrike
- The option strike.public static double blackScholesDigitalOptionDelta(double initialStockValue, double riskFreeRate, double volatility, double optionMaturity, double optionStrike)
initialStockValue
- The initial value of the underlying, i.e., the spot.riskFreeRate
- The risk free rate of the bank account numerarie.volatility
- The Black-Scholes volatility.optionMaturity
- The option maturity T.optionStrike
- The option strike.public static double blackScholesDigitalOptionVega(double initialStockValue, double riskFreeRate, double volatility, double optionMaturity, double optionStrike)
initialStockValue
- The initial value of the underlying, i.e., the spot.riskFreeRate
- The risk free rate of the bank account numerarie.volatility
- The Black-Scholes volatility.optionMaturity
- The option maturity T.optionStrike
- The option strike.public static double blackScholesDigitalOptionRho(double initialStockValue, double riskFreeRate, double volatility, double optionMaturity, double optionStrike)
initialStockValue
- The initial value of the underlying, i.e., the spot.riskFreeRate
- The risk free rate of the bank account numerarie.volatility
- The Black-Scholes volatility.optionMaturity
- The option maturity T.optionStrike
- The option strike.public static double blackModelCapletValue(double forward, double volatility, double optionMaturity, double optionStrike, double periodLength, double discountFactor)
forward
- The forward (spot).volatility
- The Black'76 volatility.optionMaturity
- The option maturityoptionStrike
- The option strike.periodLength
- The period length of the underlying forward rate.discountFactor
- The discount factor corresponding to the payment date (option maturity + period length).public static double blackModelDgitialCapletValue(double forward, double volatility, double periodLength, double discountFactor, double optionMaturity, double optionStrike)
forward
- The forward (spot).volatility
- The Black'76 volatility.periodLength
- The period length of the underlying forward rate.discountFactor
- The discount factor corresponding to the payment date (option maturity + period length).optionMaturity
- The option maturityoptionStrike
- The option strike.public static double blackModelSwaptionValue(double forwardSwaprate, double volatility, double optionMaturity, double optionStrike, double swapAnnuity)
forwardSwaprate
- The forward (spot)volatility
- The Black'76 volatility.optionMaturity
- The option maturity.optionStrike
- The option strike.swapAnnuity
- The swap annuity corresponding to the underlying swap.public static double margrabeExchangeOptionValue(double spot1, double spot2, double volatility1, double volatility2, double correlation, double optionMaturity)
spot1
- Value of \( S_{1}(0) \)spot2
- Value of \( S_{2}(0) \)volatility1
- Volatility of \( \log(S_{1}(t)) \)volatility2
- Volatility of \( \log(S_{2}(t)) \)correlation
- Instantaneous correlation of \( \log(S_{1}(t)) \) and \( \log(S_{2}(t)) \)optionMaturity
- The option maturity \( T \).public static double bachelierOptionValue(double forward, double volatility, double optionMaturity, double optionStrike, double payoffUnit)
forward
- The forward of the underlying \( F = S(T) \exp(r T) \).volatility
- The Bachelier volatility \( \sigma \).optionMaturity
- The option maturity T.optionStrike
- The option strike K.payoffUnit
- The payoff unit (e.g., the discount factor)public static RandomVariable bachelierOptionValue(RandomVariable forward, RandomVariable volatility, double optionMaturity, double optionStrike, RandomVariable payoffUnit)
forward
- The forward of the underlying \( F = S(T) \exp(r T) \).volatility
- The Bachelier volatility \( \sigma \).optionMaturity
- The option maturity T.optionStrike
- The option strike.payoffUnit
- The payoff unit (e.g., the discount factor)public static double bachelierOptionImpliedVolatility(double forward, double optionMaturity, double optionStrike, double payoffUnit, double optionValue)
max(S(T)-K,0)
, where S follows a normal process with constant volatility.forward
- The forward of the underlying.optionMaturity
- The option maturity T.optionStrike
- The option strike. If the option strike is ≤ 0.0 the method returns the value of the forward contract paying S(T)-K in T.payoffUnit
- The payoff unit (e.g., the discount factor)optionValue
- The option value.public static double bachelierOptionDelta(double forward, double volatility, double optionMaturity, double optionStrike, double payoffUnit)
forward
- The forward of the underlying \( F = S(T) \exp(r T) \).volatility
- The Bachelier volatility \( \sigma \).optionMaturity
- The option maturity T.optionStrike
- The option strike K.payoffUnit
- The payoff unit (e.g., the discount factor)public static double huntKennedyCMSOptionValue(double forwardSwaprate, double volatility, double swapAnnuity, double optionMaturity, double swapMaturity, double payoffUnit, double optionStrike)
forwardSwaprate
- The forward swap ratevolatility
- Volatility of the log of the swap rateswapAnnuity
- The swap annuityoptionMaturity
- The option maturityswapMaturity
- The swap maturitypayoffUnit
- The payoff unit, e.g., the discount factor corresponding to the payment dateoptionStrike
- The option strikepublic static double huntKennedyCMSFloorValue(double forwardSwaprate, double volatility, double swapAnnuity, double optionMaturity, double swapMaturity, double payoffUnit, double optionStrike)
forwardSwaprate
- The forward swap ratevolatility
- Volatility of the log of the swap rateswapAnnuity
- The swap annuityoptionMaturity
- The option maturityswapMaturity
- The swap maturitypayoffUnit
- The payoff unit, e.g., the discount factor corresponding to the payment dateoptionStrike
- The option strikepublic static double huntKennedyCMSAdjustedRate(double forwardSwaprate, double volatility, double swapAnnuity, double optionMaturity, double swapMaturity, double payoffUnit)
forwardSwaprate
- The forward swap ratevolatility
- Volatility of the log of the swap rateswapAnnuity
- The swap annuityoptionMaturity
- The option maturityswapMaturity
- The swap maturitypayoffUnit
- The payoff unit, e.g., the discount factor corresponding to the payment datepublic static double sabrHaganLognormalBlackVolatilityApproximation(double alpha, double beta, double rho, double nu, double underlying, double strike, double maturity)
alpha
- initial value of the stochastic volatility process of the SABR model.beta
- CEV parameter of the SABR model.rho
- Correlation (leverages) of the stochastic volatility.nu
- Volatility of the stochastic volatility (vol-of-vol).underlying
- Underlying (spot) value.strike
- Strike.maturity
- Maturity.public static double sabrHaganLognormalBlackVolatilityApproximation(double alpha, double beta, double rho, double nu, double displacement, double underlying, double strike, double maturity)
alpha
- initial value of the stochastic volatility process of the SABR model.beta
- CEV parameter of the SABR model.rho
- Correlation (leverages) of the stochastic volatility.nu
- Volatility of the stochastic volatility (vol-of-vol).displacement
- The displacement parameter d.underlying
- Underlying (spot) value.strike
- Strike.maturity
- Maturity.public static double sabrBerestyckiNormalVolatilityApproximation(double alpha, double beta, double rho, double nu, double displacement, double underlying, double strike, double maturity)
alpha
- initial value of the stochastic volatility process of the SABR model.beta
- CEV parameter of the SABR model.rho
- Correlation (leverages) of the stochastic volatility.nu
- Volatility of the stochastic volatility (vol-of-vol).displacement
- The displacement parameter d.underlying
- Underlying (spot) value.strike
- Strike.maturity
- Maturity.public static double sabrNormalVolatilityApproximation(double alpha, double beta, double rho, double nu, double displacement, double underlying, double strike, double maturity)
alpha
- initial value of the stochastic volatility process of the SABR model.beta
- CEV parameter of the SABR model.rho
- Correlation (leverages) of the stochastic volatility.nu
- Volatility of the stochastic volatility (vol-of-vol).displacement
- The displacement parameter d.underlying
- Underlying (spot) value.strike
- Strike.maturity
- Maturity.public static double sabrAlphaApproximation(double normalVolatility, double beta, double rho, double nu, double displacement, double underlying, double maturity)
normalVolatility
- ATM volatility to match.beta
- CEV parameter of the SABR model.rho
- Correlation (leverages) of the stochastic volatility.nu
- Volatility of the stochastic volatility (vol-of-vol).displacement
- The displacement parameter d.underlying
- Underlying (spot) value.maturity
- Maturity.public static double sabrNormalVolatilitySkewApproximation(double alpha, double beta, double rho, double nu, double displacement, double underlying, double maturity)
alpha
- initial value of the stochastic volatility process of the SABR model.beta
- CEV parameter of the SABR model.rho
- Correlation (leverages) of the stochastic volatility.nu
- Volatility of the stochastic volatility (vol-of-vol).displacement
- The displacement parameter d.underlying
- Underlying (spot) value.maturity
- Maturity.public static double sabrNormalVolatilityCurvatureApproximation(double alpha, double beta, double rho, double nu, double displacement, double underlying, double maturity)
alpha
- initial value of the stochastic volatility process of the SABR model.beta
- CEV parameter of the SABR model.rho
- Correlation (leverages) of the stochastic volatility.nu
- Volatility of the stochastic volatility (vol-of-vol).displacement
- The displacement parameter d.underlying
- Underlying (spot) value.maturity
- Maturity.public static double volatilityConversionLognormalATMtoNormalATM(double forward, double displacement, double maturity, double lognormalVolatiltiy)
forward
- The forwarddisplacement
- The displacement (considering a displaced lognormal model, otherwise 0.maturity
- The maturitylognormalVolatiltiy
- The (implied) lognormal volatility.public static double price(Date settlementDate, Date maturityDate, double coupon, double yield, double redemption, int frequency)
settlementDate
- Valuation date.maturityDate
- Maturity date of the bond.coupon
- Coupon payment.yield
- Yield (discount factor, using frequency: 1/(1 + yield/frequency).redemption
- Redemption (notional repayment).frequency
- Frequency (1,2,4).public static double price(double timeToMaturity, double coupon, double yield, double redemption, int frequency)
timeToMaturity
- The time to maturity.coupon
- Coupon payment.yield
- Yield (discount factor, using frequency: 1/(1 + yield/frequency).redemption
- Redemption (notional repayment).frequency
- Frequency (1,2,4).public static double bachelierGeneralizedOptionVega(double forward, double volatility, double optionMaturity, double optionStrike, double payoffUnit)
forward
- The forward of the underlying \( F = S(T) \exp(r T) \).volatility
- The Bachelier volatility \( \sigma \).optionMaturity
- The option maturity T.optionStrike
- The option strike.payoffUnit
- The payoff unit (e.g., the discount factor)public static double blackScholesGeneralizedOptionVega(double forward, double volatility, double optionMaturity, double optionStrike, double payoffUnit)
forward
- The forward of the underlying \( F = S(T) \exp(r T) \).volatility
- The Black-Scholes volatility \( \sigma \).optionMaturity
- The option maturity T.optionStrike
- The option strike.payoffUnit
- The payoff unit (e.g., the discount factor)Copyright © 2019. All rights reserved.