AlgoQuant, an integrated trading strategy research and backtesting system
com.numericalmethod.algoquant.model.breeden1978

## Class OptionBasedRiskNeutralDistributionFactory

• java.lang.Object
• com.numericalmethod.algoquant.model.breeden1978.OptionBasedRiskNeutralDistributionFactory

• public class OptionBasedRiskNeutralDistributionFactory
extends Object
Generates cumulative distribution function (CDF) of the underlying price at maturity from European option prices by the following steps.
1. Given a list of call (or put) options for the same underlying expired on the same date, compute the implied volatilities for different strike prices by Black-Scholes formula.
2. Interpolate a volatility smile curve from the computed values.
3. Convert the smile back to option price curve by Black-Scholes formula.
4. By Breeden-Litzenberger theorem, the cumulative distribution function of the future asset price is given by
1 + exp(r(t-T)) * d^2 C(K) / d K^2
Implementation notes: this class uses the following techniques which solve the classic negative PDF issue:
• Use "clamped" cubic spline with zero first derivative at both ends for the interpolation step.
• Allow dynamic adjustment of step size when doing finite difference for the differentiation step.
References:
• Breeden, D. T. and Litzenberger, R. H., "Prices of state-contingent claims implicit in option prices," Journal of Business 51(4), pp. 621–651, 1978.
• Allan M. Malz, "A Simple and Reliable Way to Compute Option-Based Risk-Neutral Distributions," Staff Report No. 677, Federal Reserve Bank of New York, June 2014.
• ### Constructor Summary

Constructors
Constructor and Description
OptionBasedRiskNeutralDistributionFactory(double dfStep, OptionChainData.OptionRight type)
OptionBasedRiskNeutralDistributionFactory(double dfStep, OptionChainData.OptionRight type, double dfStepConv)
OptionBasedRiskNeutralDistributionFactory(double dfStep, OptionChainData.OptionRight type, double dfStepConv, boolean showPlots)
OptionBasedRiskNeutralDistributionFactory(double dfStep, OptionChainData.OptionRight type, double dfStepConv, boolean showPlots, com.numericalmethod.suanshu.interval.Interval<Double> plotInterval, int plotPointCount)
Creates an instance that generates risk-neutral distributions (RND) based on the prices of the given type of options.
• ### Method Summary

All Methods
Modifier and Type Method and Description
OptionBasedRiskNeutralDistribution generate(List<OptionChainData.OptionData> data, double S, double r, org.joda.time.LocalDate t, org.joda.time.LocalDate T)
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### OptionBasedRiskNeutralDistributionFactory

public OptionBasedRiskNeutralDistributionFactory(double dfStep,
OptionChainData.OptionRight type)
• #### OptionBasedRiskNeutralDistributionFactory

public OptionBasedRiskNeutralDistributionFactory(double dfStep,
OptionChainData.OptionRight type,
double dfStepConv)
• #### OptionBasedRiskNeutralDistributionFactory

public OptionBasedRiskNeutralDistributionFactory(double dfStep,
OptionChainData.OptionRight type,
double dfStepConv,
boolean showPlots)
• #### OptionBasedRiskNeutralDistributionFactory

public OptionBasedRiskNeutralDistributionFactory(double dfStep,
OptionChainData.OptionRight type,
double dfStepConv,
boolean showPlots,
com.numericalmethod.suanshu.interval.Interval<Double> plotInterval,
int plotPointCount)
Creates an instance that generates risk-neutral distributions (RND) based on the prices of the given type of options.
Parameters:
dfStep - the step size used in finite difference
type - the option type from which the distribution is computed
dfStepConv - the convergence parameter for dfStep, e.g., 0.005
showPlots - show plots or not
plotInterval - the interval of strike, relative to the spot price S, for which the plot is shown, e.g., [0.85, 1.15] means from 85% S to 115% S
plotPointCount - plot granularity; the number of points plotted in the plot interval
• ### Method Detail

• #### generate

public OptionBasedRiskNeutralDistribution generate(List<OptionChainData.OptionData> data,
double S,
double r,
org.joda.time.LocalDate t,
org.joda.time.LocalDate T)
throws Exception
Throws:
Exception