public class RatesFiniteDifferenceSensitivityCalculator extends Object
This is based on an ImmutableRatesProvider, LegalEntityDiscountingProvider or CreditRatesProvider.
The sensitivities are calculated by finite difference.
| Modifier and Type | Field and Description |
|---|---|
static RatesFiniteDifferenceSensitivityCalculator |
DEFAULT
Default implementation.
|
| Constructor and Description |
|---|
RatesFiniteDifferenceSensitivityCalculator(double shift)
Create an instance of the finite difference calculator.
|
| Modifier and Type | Method and Description |
|---|---|
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. |
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.
|
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.
|
public static final RatesFiniteDifferenceSensitivityCalculator DEFAULT
public RatesFiniteDifferenceSensitivityCalculator(double shift)
shift - the shift used in the finite difference computationpublic CurrencyParameterSensitivities sensitivity(RatesProvider provider, Function<ImmutableRatesProvider,CurrencyAmount> valueFn)
The finite difference is computed by forward type. The function should return a value in the same currency for any rate provider.
provider - the rates providervalueFn - the function from a rate provider to a currency amount for which the sensitivity should be computedpublic CurrencyParameterSensitivities sensitivity(LegalEntityDiscountingProvider provider, Function<ImmutableLegalEntityDiscountingProvider,CurrencyAmount> valueFn)
The finite difference is computed by forward type. The function should return a value in the same currency for any rates provider of LegalEntityDiscountingProvider.
provider - the rates providervalueFn - the function from a rate provider to a currency amount for which the sensitivity should be computedpublic CurrencyParameterSensitivities sensitivity(CreditRatesProvider provider, Function<ImmutableCreditRatesProvider,CurrencyAmount> valueFn)
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.
provider - the rates providervalueFn - the function from a rate provider to a currency amount for which the sensitivity should be computedCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.