Class CalibrationMeasures


  • public final class CalibrationMeasures
    extends Object
    Provides access to the measures needed to perform curve calibration.

    The most commonly used measures are par spread and converted present value.

    • Field Detail

      • PAR_SPREAD

        public static final CalibrationMeasures PAR_SPREAD
        The par spread instance, which is the default used in curve calibration.

        This computes par spread for Term Deposits, IborFixingDeposit, FRA, Ibor Futures Swap and FX Swap by discounting.

      • MARKET_QUOTE

        public static final CalibrationMeasures MARKET_QUOTE
        The market quote instance, which is the default used in synthetic curve calibration.

        This computes par rate for Term Deposits, IborFixingDeposit, FRA and Swap by discounting, and price Ibor Futures by discounting.

      • PRESENT_VALUE

        public static final CalibrationMeasures PRESENT_VALUE
        The present value instance, which is the default used in present value sensitivity to market quote stored during curve calibration.

        This computes present value for Term Deposits, IborFixingDeposit, FRA and Swap by discounting, and price Ibor Futures by discounting; the derivative is the derivative with respect to the market quotes.

    • Method Detail

      • of

        public static CalibrationMeasures of​(String name,
                                             List<? extends CalibrationMeasure<? extends ResolvedTrade>> measures)
        Obtains an instance from a list of individual trade-specific measures.

        Each measure must be for a different trade type.

        Parameters:
        name - the name of the set of measures
        measures - the list of measures
        Returns:
        the calibration measures
        Throws:
        IllegalArgumentException - if a trade type is specified more than once
      • getName

        public String getName()
        Gets the name of the set of measures.
        Returns:
        the name
      • getTradeTypes

        public ImmutableSet<Class<?>> getTradeTypes()
        Gets the supported trade types.
        Returns:
        the supported trade types
      • value

        public double value​(ResolvedTrade trade,
                            RatesProvider provider)
        Calculates the value, such as par spread.

        The value must be calculated using the specified rates provider.

        Parameters:
        trade - the trade
        provider - the rates provider
        Returns:
        the sensitivity
        Throws:
        IllegalArgumentException - if the trade cannot be valued
      • derivative

        public DoubleArray derivative​(ResolvedTrade trade,
                                      RatesProvider provider,
                                      List<CurveParameterSize> curveOrder)
        Calculates the sensitivity with respect to the rates provider.

        The result array is composed of the concatenated curve sensitivities from all curves currently being processed.

        Parameters:
        trade - the trade
        provider - the rates provider
        curveOrder - the order of the curves
        Returns:
        the sensitivity derivative