Class ImpliedTrinomialTreeLocalVolatilityCalculator

  • All Implemented Interfaces:
    LocalVolatilityCalculator

    public class ImpliedTrinomialTreeLocalVolatilityCalculator
    extends Object
    implements LocalVolatilityCalculator
    Local volatility calculation based on trinomila tree model.

    Emanuel Derman, Iraj Kani and Neil Chriss, "Implied Trinomial Trees of the Volatility Smile" (1996).

    • Constructor Detail

      • ImpliedTrinomialTreeLocalVolatilityCalculator

        public ImpliedTrinomialTreeLocalVolatilityCalculator()
        Creates an instance with default setups.

        The number of time steps is 20, and the tree covers up to 3 years. The time square linear interpolator is used for time direction, whereas the linear interpolator is used for spot dimension. The extrapolation is flat for both the dimensions.

      • ImpliedTrinomialTreeLocalVolatilityCalculator

        public ImpliedTrinomialTreeLocalVolatilityCalculator​(int nSteps,
                                                             double maxTime)
        Creates an instance with the number of steps and maximum time fixed.

        The default interpolators are used: the time square linear interpolator for time direction, the linear interpolator for spot dimension, and flat extrapolator for both the dimensions.

        Parameters:
        nSteps - the number of steps
        maxTime - the maximum time
      • ImpliedTrinomialTreeLocalVolatilityCalculator

        public ImpliedTrinomialTreeLocalVolatilityCalculator​(int nSteps,
                                                             double maxTime,
                                                             SurfaceInterpolator interpolator)
        Creates an instance by specifying the number of steps, maximum time, and 2D interpolator.
        Parameters:
        nSteps - number of steps
        maxTime - the maximum time
        interpolator - the interpolator
    • Method Detail

      • localVolatilityFromImpliedVolatility

        public InterpolatedNodalSurface localVolatilityFromImpliedVolatility​(Surface impliedVolatilitySurface,
                                                                             double spot,
                                                                             Function<Double,​Double> interestRate,
                                                                             Function<Double,​Double> dividendRate)
        Description copied from interface: LocalVolatilityCalculator
        Computes local volatility surface from implied volatility surface.

        The implied volatility surface must be spanned by time to expiry and strike.

        The interest rate and dividend rate must be zero-coupon continuously compounded rates based on respective day count convention. Thus interestRate and dividendRate are functions from year fraction to zero rate.

        Specified by:
        localVolatilityFromImpliedVolatility in interface LocalVolatilityCalculator
        Parameters:
        impliedVolatilitySurface - the implied volatility surface
        spot - the spot
        interestRate - the interest rate
        dividendRate - the dividend
        Returns:
        the local volatility surface
      • calibrateImpliedVolatility

        public RecombiningTrinomialTreeData calibrateImpliedVolatility​(Function<DoublesPair,​Double> impliedVolatilitySurface,
                                                                       double spot,
                                                                       Function<Double,​Double> interestRate,
                                                                       Function<Double,​Double> dividendRate)
        Calibrate trinomial tree to implied volatility surface.
        Parameters:
        impliedVolatilitySurface - the implied volatility surface
        spot - the spot
        interestRate - the interest rate
        dividendRate - the dividend rate
        Returns:
        the trinomial tree
      • localVolatilityFromPrice

        public InterpolatedNodalSurface localVolatilityFromPrice​(Surface callPriceSurface,
                                                                 double spot,
                                                                 Function<Double,​Double> interestRate,
                                                                 Function<Double,​Double> dividendRate)
        Description copied from interface: LocalVolatilityCalculator
        Computes local volatility surface from call price surface.

        The interest rate and dividend rate must be zero-coupon continuously compounded rates based on respective day count convention. Thus interestRate and dividendRate are functions from year fraction to zero rate.

        Specified by:
        localVolatilityFromPrice in interface LocalVolatilityCalculator
        Parameters:
        callPriceSurface - the price surface
        spot - the spot
        interestRate - the interest rate
        dividendRate - the dividend rate
        Returns:
        the local volatility surface