Class PointShifts
- java.lang.Object
-
- com.opengamma.strata.market.param.PointShifts
-
- All Implemented Interfaces:
ScenarioPerturbation<ParameterizedData>
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class PointShifts extends Object implements ScenarioPerturbation<ParameterizedData>, org.joda.beans.ImmutableBean, Serializable
A perturbation that applies different shifts to specific points in a parameterized data.Examples of parameterized data include curve, option volatilities and model parameters.
This class contains a set of shifts, each one associated with a different parameter in the data. Each shift has an associated key that is matched against the parameterized data. In order for this to work the parameterized data must have matching and unique parameter metadata.
When matching the shift to the parameterized data, either the identifier or label parameter may be used. A shift is not applied if there is no point on the parameterized data with a matching identifier.
- See Also:
ParameterMetadata.getIdentifier()
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PointShifts.Meta
The meta-bean forPointShifts
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MarketDataBox<ParameterizedData>
applyTo(MarketDataBox<ParameterizedData> marketData, ReferenceData refData)
Applies this perturbation to the market data in a box, returning a box containing new, modified data.static PointShiftsBuilder
builder(ShiftType shiftType)
Returns a new mutable builder for building instances ofParameterizedDataPointShifts
.boolean
equals(Object obj)
Class<ParameterizedData>
getMarketDataType()
Returns the market data type that the perturbation changes.ImmutableMap<Object,Integer>
getNodeIndices()
Gets indices of each parameter, keyed by an object identifying the node.int
getScenarioCount()
Returns the number of scenarios for which this perturbation generates data.DoubleMatrix
getShifts()
Gets the shift to apply to the rates.ShiftType
getShiftType()
Gets the type of shift applied to the parameters.int
hashCode()
static PointShifts.Meta
meta()
The meta-bean forPointShifts
.PointShifts.Meta
metaBean()
String
toString()
-
-
-
Method Detail
-
builder
public static PointShiftsBuilder builder(ShiftType shiftType)
Returns a new mutable builder for building instances ofParameterizedDataPointShifts
.- Parameters:
shiftType
- the type of shift to apply to the rates- Returns:
- a new mutable builder for building instances of
ParameterizedDataPointShifts
-
applyTo
public MarketDataBox<ParameterizedData> applyTo(MarketDataBox<ParameterizedData> marketData, ReferenceData refData)
Description copied from interface:ScenarioPerturbation
Applies this perturbation to the market data in a box, returning a box containing new, modified data.The original market data must not be altered. Instead a perturbed copy must be returned.
- Specified by:
applyTo
in interfaceScenarioPerturbation<ParameterizedData>
- Parameters:
marketData
- the market data to perturbrefData
- the reference data- Returns:
- new market data derived by applying the perturbation to the input data
-
getScenarioCount
public int getScenarioCount()
Description copied from interface:ScenarioPerturbation
Returns the number of scenarios for which this perturbation generates data.- Specified by:
getScenarioCount
in interfaceScenarioPerturbation<ParameterizedData>
- Returns:
- the number of scenarios for which this perturbation generates data
-
getMarketDataType
public Class<ParameterizedData> getMarketDataType()
Description copied from interface:ScenarioPerturbation
Returns the market data type that the perturbation changes.- Specified by:
getMarketDataType
in interfaceScenarioPerturbation<ParameterizedData>
- Returns:
- the data type
-
meta
public static PointShifts.Meta meta()
The meta-bean forPointShifts
.- Returns:
- the meta-bean, not null
-
metaBean
public PointShifts.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getShiftType
public ShiftType getShiftType()
Gets the type of shift applied to the parameters.- Returns:
- the value of the property, not null
-
getShifts
public DoubleMatrix getShifts()
Gets the shift to apply to the rates.There is one row in the matrix for each scenario and one column for each parameter in the data. Node indices are found using
nodeIndices
.- Returns:
- the value of the property, not null
-
getNodeIndices
public ImmutableMap<Object,Integer> getNodeIndices()
Gets indices of each parameter, keyed by an object identifying the node.The key is typically the node identifier. The key may also be the node label.
- Returns:
- the value of the property, not null
-
-