Class RatesFiniteDifferenceSensitivityCalculator

    • Constructor Detail

      • RatesFiniteDifferenceSensitivityCalculator

        public RatesFiniteDifferenceSensitivityCalculator​(double shift)
        Create an instance of the finite difference calculator.
        Parameters:
        shift - the shift used in the finite difference computation
    • Method Detail

      • sensitivity

        public CurrencyParameterSensitivities sensitivity​(RatesProvider provider,
                                                          Function<ImmutableRatesProvider,​CurrencyAmount> valueFn)
        Computes the first order sensitivities of a function of a RatesProvider to a double by finite difference.

        The finite difference is computed by forward type. The function should return a value in the same currency for any rate provider.

        Parameters:
        provider - the rates provider
        valueFn - the function from a rate provider to a currency amount for which the sensitivity should be computed
        Returns:
        the curve sensitivity
      • sensitivity

        public CurrencyParameterSensitivities sensitivity​(LegalEntityDiscountingProvider provider,
                                                          Function<ImmutableLegalEntityDiscountingProvider,​CurrencyAmount> valueFn)
        Computes the first order sensitivities of a function of a LegalEntityDiscountingProvider to a double by finite difference.

        The finite difference is computed by forward type. The function should return a value in the same currency for any rates provider of LegalEntityDiscountingProvider.

        Parameters:
        provider - the rates provider
        valueFn - the function from a rate provider to a currency amount for which the sensitivity should be computed
        Returns:
        the curve sensitivity
      • sensitivity

        public CurrencyParameterSensitivities sensitivity​(CreditRatesProvider provider,
                                                          Function<ImmutableCreditRatesProvider,​CurrencyAmount> valueFn)
        Computes the first order sensitivities of a function of a CreditRatesProvider to a double by finite difference.

        The finite difference is computed by forward type. The function should return a value in the same currency for any rates provider of CreditRatesProvider.

        Parameters:
        provider - the rates provider
        valueFn - the function from a rate provider to a currency amount for which the sensitivity should be computed
        Returns:
        the curve sensitivity