Class SabrModelFitter
- java.lang.Object
-
- com.opengamma.strata.pricer.impl.volatility.smile.SmileModelFitter<SabrFormulaData>
-
- com.opengamma.strata.pricer.impl.volatility.smile.SabrModelFitter
-
public final class SabrModelFitter extends SmileModelFitter<SabrFormulaData>
SABR model fitter.Attempts to calibrate SABR model to the implied volatilities of European vanilla options, by minimizing the sum of squares between the market and model implied volatilities.
All the options must be for the same expiry and (implicitly) on the same underlying.
-
-
Constructor Summary
Constructors Constructor Description SabrModelFitter(double forward, DoubleArray strikes, double timeToExpiry, DoubleArray impliedVols, DoubleArray error, VolatilityFunctionProvider<SabrFormulaData> model)
Constructs SABR model fitter from forward, strikes, time to expiry, implied volatilities and error values.SabrModelFitter(double forward, DoubleArray strikes, double timeToExpiry, DoubleArray impliedVols, DoubleArray error, SabrVolatilityFormula sabrVolatilityFormula)
Constructs SABR model fitter from forward, strikes, time to expiry, implied volatilities and error values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DoubleArray
getMaximumStep()
Obtains the maximum number of iterations.protected NonLinearParameterTransforms
getTransform(DoubleArray start)
Obtains the nonlinear transformation of parameters from the initial values.protected NonLinearParameterTransforms
getTransform(DoubleArray start, BitSet fixed)
Obtains the nonlinear transformation of parameters from the initial values with some parameters fixed.SabrFormulaData
toSmileModelData(DoubleArray modelParameters)
ObtainsSmileModelData
instance from the model parameters.-
Methods inherited from class com.opengamma.strata.pricer.impl.volatility.smile.SmileModelFitter
getConstraintFunction, getModel, getModelJacobianFunction, getModelValueFunction, solve, solve, solve
-
-
-
-
Constructor Detail
-
SabrModelFitter
public SabrModelFitter(double forward, DoubleArray strikes, double timeToExpiry, DoubleArray impliedVols, DoubleArray error, SabrVolatilityFormula sabrVolatilityFormula)
Constructs SABR model fitter from forward, strikes, time to expiry, implied volatilities and error values.strikes
,impliedVols
anderror
should be the same length and ordered coherently.- Parameters:
forward
- the forward value of the underlyingstrikes
- the ordered values of strikestimeToExpiry
- the time-to-expiryimpliedVols
- the market implied volatilitieserror
- the 'measurement' error to apply to the market volatility of a particular optionsabrVolatilityFormula
- the volatility formula
-
SabrModelFitter
public SabrModelFitter(double forward, DoubleArray strikes, double timeToExpiry, DoubleArray impliedVols, DoubleArray error, VolatilityFunctionProvider<SabrFormulaData> model)
Constructs SABR model fitter from forward, strikes, time to expiry, implied volatilities and error values.strikes
,impliedVols
anderror
should be the same length and ordered coherently.- Parameters:
forward
- the forward value of the underlyingstrikes
- the ordered values of strikestimeToExpiry
- the time-to-expiryimpliedVols
- the market implied volatilitieserror
- the 'measurement' error to apply to the market volatility of a particular optionmodel
- the volatility function provider
-
-
Method Detail
-
toSmileModelData
public SabrFormulaData toSmileModelData(DoubleArray modelParameters)
Description copied from class:SmileModelFitter
ObtainsSmileModelData
instance from the model parameters.- Specified by:
toSmileModelData
in classSmileModelFitter<SabrFormulaData>
- Parameters:
modelParameters
- the model parameters- Returns:
- the smile model data
-
getTransform
protected NonLinearParameterTransforms getTransform(DoubleArray start)
Description copied from class:SmileModelFitter
Obtains the nonlinear transformation of parameters from the initial values.- Specified by:
getTransform
in classSmileModelFitter<SabrFormulaData>
- Parameters:
start
- the initial values- Returns:
- the nonlinear transformation
-
getTransform
protected NonLinearParameterTransforms getTransform(DoubleArray start, BitSet fixed)
Description copied from class:SmileModelFitter
Obtains the nonlinear transformation of parameters from the initial values with some parameters fixed.- Specified by:
getTransform
in classSmileModelFitter<SabrFormulaData>
- Parameters:
start
- the initial valuesfixed
- the parameters are fixed- Returns:
- the nonlinear transformation
-
getMaximumStep
protected DoubleArray getMaximumStep()
Description copied from class:SmileModelFitter
Obtains the maximum number of iterations.- Specified by:
getMaximumStep
in classSmileModelFitter<SabrFormulaData>
- Returns:
- the maximum number.
-
-