T - the type of rate to be observedpublic interface RateComputationFn<T extends RateComputation>
This function provides the ability to compute a rate defined by RateComputation.
The rate will be based on known historic data and forward curves.
Implementations must be immutable and thread-safe functions.
| Modifier and Type | Method and Description |
|---|---|
double |
explainRate(T computation,
LocalDate startDate,
LocalDate endDate,
RatesProvider provider,
ExplainMapBuilder builder)
Explains the calculation of the applicable rate.
|
double |
rate(T computation,
LocalDate startDate,
LocalDate endDate,
RatesProvider provider)
Determines the applicable rate for the computation.
|
PointSensitivityBuilder |
rateSensitivity(T computation,
LocalDate startDate,
LocalDate endDate,
RatesProvider provider)
Determines the point sensitivity for the rate computation.
|
static RateComputationFn<RateComputation> |
standard()
Returns the standard instance of the function.
|
static RateComputationFn<RateComputation> standard()
Use this method to avoid a direct dependency on the implementation.
double rate(T computation, LocalDate startDate, LocalDate endDate, RatesProvider provider)
Each type of rate has specific rules, encapsulated in RateComputation.
The start date and end date refer to the accrual period. In many cases, this information is not necessary, however it does enable some implementations that would not otherwise be possible.
computation - the computation definitionstartDate - the start date of the accrual periodendDate - the end date of the accrual periodprovider - the rates providerPointSensitivityBuilder rateSensitivity(T computation, LocalDate startDate, LocalDate endDate, RatesProvider provider)
This returns a sensitivity instance referring to the curves used to determine each forward rate.
computation - the computation definitionstartDate - the start date of the accrual periodendDate - the end date of the accrual periodprovider - the rates providerdouble explainRate(T computation, LocalDate startDate, LocalDate endDate, RatesProvider provider, ExplainMapBuilder builder)
This adds information to the ExplainMapBuilder to aid understanding of the computation.
The actual rate is also returned.
computation - the computation definitionstartDate - the start date of the accrual periodendDate - the end date of the accrual periodprovider - the rates providerbuilder - the builder to populateCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.