Class GenericImpliedVolatiltySolver
- java.lang.Object
-
- com.opengamma.strata.pricer.impl.option.GenericImpliedVolatiltySolver
-
public class GenericImpliedVolatiltySolver extends Object
Finds an implied volatility (a parameter that put into a model gives the market pirce of an option) for any option pricing model that has a 'volatility' parameter. This included the Black-Scholes-Merton model (and derivatives) for European options and Barone-Adesi & Whaley and Bjeksund and Stensland for American options.
-
-
Constructor Summary
Constructors Constructor Description GenericImpliedVolatiltySolver(Function<Double,double[]> priceAndVegaFunc)Creates an instance.GenericImpliedVolatiltySolver(Function<Double,Double> priceFunc, Function<Double,Double> vegaFunc)Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleimpliedVolatility(double optionPrice)Computes the implied volatility.doubleimpliedVolatility(double optionPrice, double volGuess)Computes the implied volatility.
-
-
-
Method Detail
-
impliedVolatility
public double impliedVolatility(double optionPrice)
Computes the implied volatility.- Parameters:
optionPrice- the option price- Returns:
- the volatility
-
impliedVolatility
public double impliedVolatility(double optionPrice, double volGuess)Computes the implied volatility.- Parameters:
optionPrice- the option pricevolGuess- the initial guess- Returns:
- the volatility
-
-