Class 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 Detail

      • GenericImpliedVolatiltySolver

        public GenericImpliedVolatiltySolver​(Function<Double,​double[]> priceAndVegaFunc)
        Creates an instance.
        Parameters:
        priceAndVegaFunc - the combined price and vega function
      • GenericImpliedVolatiltySolver

        public GenericImpliedVolatiltySolver​(Function<Double,​Double> priceFunc,
                                             Function<Double,​Double> vegaFunc)
        Creates an instance.
        Parameters:
        priceFunc - the pricing function
        vegaFunc - the vega function
    • 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 price
        volGuess - the initial guess
        Returns:
        the volatility