Class PresentValueCalibrationMeasure<T extends ResolvedTrade>
- java.lang.Object
-
- com.opengamma.strata.pricer.curve.PresentValueCalibrationMeasure<T>
-
- Type Parameters:
T
- the trade type
- All Implemented Interfaces:
CalibrationMeasure<T>
public final class PresentValueCalibrationMeasure<T extends ResolvedTrade> extends Object implements CalibrationMeasure<T>
Provides calibration measures for a single type of trade based on functions.This set of measures return the present value of the product. For multi-currency instruments, the present value is converted into the currency of the first leg. The sensitivities are with respect to the market quote sensitivities and are also converted in the currency of the first leg when necessary.
-
-
Field Summary
Fields Modifier and Type Field Description static PresentValueCalibrationMeasure<ResolvedFraTrade>
FRA_PV
The measure forFraTrade
using present value discounting.static PresentValueCalibrationMeasure<ResolvedIborFixingDepositTrade>
IBOR_FIXING_DEPOSIT_PV
The calibrator forIborFixingDepositTrade
using present value discounting.static PresentValueCalibrationMeasure<ResolvedIborFutureTrade>
IBOR_FUTURE_PV
The calibrator forIborFutureTrade
using present value discounting.static PresentValueCalibrationMeasure<ResolvedOvernightFutureTrade>
OVERNIGHT_FUTURE_PV
The calibrator forOvernightFutureTrade
using present value discounting.static PresentValueCalibrationMeasure<ResolvedSwapTrade>
SWAP_PV
The calibrator forSwapTrade
using present value discounting.static PresentValueCalibrationMeasure<ResolvedTermDepositTrade>
TERM_DEPOSIT_PV
The calibrator forTermDepositTrade
using present value discounting.
-
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>
PresentValueCalibrationMeasure<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_PV
public static final PresentValueCalibrationMeasure<ResolvedFraTrade> FRA_PV
The measure forFraTrade
using present value discounting.
-
IBOR_FUTURE_PV
public static final PresentValueCalibrationMeasure<ResolvedIborFutureTrade> IBOR_FUTURE_PV
The calibrator forIborFutureTrade
using present value discounting.
-
OVERNIGHT_FUTURE_PV
public static final PresentValueCalibrationMeasure<ResolvedOvernightFutureTrade> OVERNIGHT_FUTURE_PV
The calibrator forOvernightFutureTrade
using present value discounting.
-
SWAP_PV
public static final PresentValueCalibrationMeasure<ResolvedSwapTrade> SWAP_PV
The calibrator forSwapTrade
using present value discounting.
-
IBOR_FIXING_DEPOSIT_PV
public static final PresentValueCalibrationMeasure<ResolvedIborFixingDepositTrade> IBOR_FIXING_DEPOSIT_PV
The calibrator forIborFixingDepositTrade
using present value discounting.
-
TERM_DEPOSIT_PV
public static final PresentValueCalibrationMeasure<ResolvedTermDepositTrade> TERM_DEPOSIT_PV
The calibrator forTermDepositTrade
using present value discounting.
-
-
Method Detail
-
of
public static <R extends ResolvedTrade> PresentValueCalibrationMeasure<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
-
-