Class TradeCalibrationMeasure<T extends ResolvedTrade>
- java.lang.Object
-
- com.opengamma.strata.pricer.curve.TradeCalibrationMeasure<T>
-
- Type Parameters:
T
- the trade type
- All Implemented Interfaces:
CalibrationMeasure<T>
public final class TradeCalibrationMeasure<T extends ResolvedTrade> extends Object implements CalibrationMeasure<T>
Provides calibration measures for a single type of trade based on functions.This is initialized using functions that typically refer to pricers.
-
-
Field Summary
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<T>
getTradeType()
Gets the trade type of the calibrator.static <R extends ResolvedTrade>
TradeCalibrationMeasure<R>of(String name, Class<R> tradeType, ToDoubleBiFunction<R,RatesProvider> valueFn, BiFunction<R,RatesProvider,PointSensitivities> sensitivityFn)
Obtains a calibrator for a specific type of trade.CurrencyParameterSensitivities
sensitivities(T trade, RatesProvider provider)
Calculates the parameter sensitivities that relate to the value.String
toString()
double
value(T trade, RatesProvider provider)
Calculates the value, such as par spread.
-
-
-
Field Detail
-
FRA_PAR_SPREAD
public static final TradeCalibrationMeasure<ResolvedFraTrade> FRA_PAR_SPREAD
The calibrator forResolvedFraTrade
using par spread discounting.
-
IBOR_FUTURE_PAR_SPREAD
public static final TradeCalibrationMeasure<ResolvedIborFutureTrade> IBOR_FUTURE_PAR_SPREAD
The calibrator forResolvedIborFutureTrade
using par spread discounting.
-
OVERNIGHT_FUTURE_PAR_SPREAD
public static final TradeCalibrationMeasure<ResolvedOvernightFutureTrade> OVERNIGHT_FUTURE_PAR_SPREAD
The calibrator forResolvedOvernightFutureTrade
using par spread discounting.
-
SWAP_PAR_SPREAD
public static final TradeCalibrationMeasure<ResolvedSwapTrade> SWAP_PAR_SPREAD
The calibrator forResolvedSwapTrade
using par spread discounting.
-
IBOR_FIXING_DEPOSIT_PAR_SPREAD
public static final TradeCalibrationMeasure<ResolvedIborFixingDepositTrade> IBOR_FIXING_DEPOSIT_PAR_SPREAD
The calibrator forResolvedIborFixingDepositTrade
using par spread discounting.
-
TERM_DEPOSIT_PAR_SPREAD
public static final TradeCalibrationMeasure<ResolvedTermDepositTrade> TERM_DEPOSIT_PAR_SPREAD
The calibrator forResolvedTermDepositTrade
using par spread discounting.
-
FX_SWAP_PAR_SPREAD
public static final TradeCalibrationMeasure<ResolvedFxSwapTrade> FX_SWAP_PAR_SPREAD
The calibrator forResolvedFxSwapTrade
using par spread discounting.
-
-
Method Detail
-
of
public static <R extends ResolvedTrade> TradeCalibrationMeasure<R> of(String name, Class<R> tradeType, ToDoubleBiFunction<R,RatesProvider> valueFn, BiFunction<R,RatesProvider,PointSensitivities> sensitivityFn)
Obtains a calibrator for a specific type of trade.The functions typically refer to pricers.
- Type Parameters:
R
- the trade type- Parameters:
name
- the nametradeType
- the trade typevalueFn
- the function for calculating the valuesensitivityFn
- the function for calculating the sensitivity- Returns:
- the calibrator
-
getTradeType
public Class<T> getTradeType()
Description copied from interface:CalibrationMeasure
Gets the trade type of the calibrator.- Specified by:
getTradeType
in interfaceCalibrationMeasure<T extends ResolvedTrade>
- Returns:
- the trade type
-
value
public double value(T trade, RatesProvider provider)
Description copied from interface:CalibrationMeasure
Calculates the value, such as par spread.The value must be calculated using the specified rates provider.
- Specified by:
value
in interfaceCalibrationMeasure<T extends ResolvedTrade>
- Parameters:
trade
- the tradeprovider
- the rates provider- Returns:
- the sensitivity
-
sensitivities
public CurrencyParameterSensitivities sensitivities(T trade, RatesProvider provider)
Description copied from interface:CalibrationMeasure
Calculates the parameter sensitivities that relate to the value.The sensitivities must be calculated using the specified rates provider.
- Specified by:
sensitivities
in interfaceCalibrationMeasure<T extends ResolvedTrade>
- Parameters:
trade
- the tradeprovider
- the rates provider- Returns:
- the sensitivity
-
-