public class CurveSensitivityUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static DoubleMatrix |
jacobianFromMarketQuoteSensitivities(List<CurveParameterSize> curveOrder,
List<CurrencyParameterSensitivities> marketQuoteSensitivities)
Construct the inverse Jacobian matrix from the sensitivities of the trades market quotes to the curve parameters.
|
static DoubleMatrix |
jacobianFromMarketQuoteSensitivities(List<CurveParameterSize> curveOrder,
List<ResolvedTrade> trades,
Function<ResolvedTrade,CurrencyParameterSensitivities> sensitivityFunction)
Construct the inverse Jacobian matrix from the trades and a function used to compute the sensitivities of the
market quotes to the curve parameters.
|
static CurrencyParameterSensitivities |
linearRebucketing(CurrencyParameterSensitivities sensitivities,
List<LocalDate> targetDates)
Re-buckets a
CurrencyParameterSensitivities to a given set of dates. |
static CurrencyParameterSensitivities |
linearRebucketing(CurrencyParameterSensitivities sensitivities,
List<LocalDate> targetDates,
LocalDate sensitivityDate)
Re-buckets a
CurrencyParameterSensitivities to a given set of dates. |
public static DoubleMatrix jacobianFromMarketQuoteSensitivities(List<CurveParameterSize> curveOrder, List<CurrencyParameterSensitivities> marketQuoteSensitivities)
All the trades and sensitivities must be in the same currency. The data should be coherent with the market quote sensitivities passed in an order coherent with the list of curves.
For each trade describing the market quotes, the sensitivity provided should be the sensitivity of that market quote to the curve parameters.
curveOrder - the order in which the curves should be represented in the jacobianmarketQuoteSensitivities - the market quotes sensitivity to the curve parameterspublic static DoubleMatrix jacobianFromMarketQuoteSensitivities(List<CurveParameterSize> curveOrder, List<ResolvedTrade> trades, Function<ResolvedTrade,CurrencyParameterSensitivities> sensitivityFunction)
All the trades must be in the same currency. The trades should be coherent with the curves order.
curveOrder - the order in which the curves should be represented in the jacobiantrades - the list of tradessensitivityFunction - the function from a trade to the market quote sensitivity to curve parameterspublic static CurrencyParameterSensitivities linearRebucketing(CurrencyParameterSensitivities sensitivities, List<LocalDate> targetDates)
CurrencyParameterSensitivities to a given set of dates.
The list of dates must be sorted in chronological order. All sensitivities are re-bucketed to the same date list.
The re-bucketing is done by linear weighting on the number of days, i.e. the sensitivities for dates outside the
extremes are fully bucketed to the extremes and for date between two re-bucketing dates, the weight on the start
date is the number days between end date and the date re-bucketed divided by the number of days between the
start and the end.
The input sensitivity should have a DatedParameterMetadata for each sensitivity.
sensitivities - the input sensitivitiestargetDates - the list of dates for the re-bucketingpublic static CurrencyParameterSensitivities linearRebucketing(CurrencyParameterSensitivities sensitivities, List<LocalDate> targetDates, LocalDate sensitivityDate)
CurrencyParameterSensitivities to a given set of dates.
The list of dates must be sorted in chronological order. All sensitivities are re-bucketed to the same date list.
The re-bucketing is done by linear weighting on the number of days, i.e. the sensitivities for dates outside the
extremes are fully bucketed to the extremes and for date between two re-bucketing dates, the weight on the start
date is the number days between end date and the date re-bucketed divided by the number of days between the
start and the end. The date of the nodes can be directly in the parameter metadata - when the metadata is of the
type DatedParameterMetadata - or inferred from the sensitivity date and the tenor when the
metadata is of the type TenorParameterMetadata. Only those types of metadata are accepted.
sensitivities - the input sensitivitiestargetDates - the list of dates for the re-bucketingsensitivityDate - the date for which the sensitivities are validCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.