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 classPointShifts.MetaThe 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 PointShiftsBuilderbuilder(ShiftType shiftType)Returns a new mutable builder for building instances ofParameterizedDataPointShifts.booleanequals(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.intgetScenarioCount()Returns the number of scenarios for which this perturbation generates data.DoubleMatrixgetShifts()Gets the shift to apply to the rates.ShiftTypegetShiftType()Gets the type of shift applied to the parameters.inthashCode()static PointShifts.Metameta()The meta-bean forPointShifts.PointShifts.MetametaBean()StringtoString()
-
-
-
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:ScenarioPerturbationApplies 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:
applyToin 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:ScenarioPerturbationReturns the number of scenarios for which this perturbation generates data.- Specified by:
getScenarioCountin interfaceScenarioPerturbation<ParameterizedData>- Returns:
- the number of scenarios for which this perturbation generates data
-
getMarketDataType
public Class<ParameterizedData> getMarketDataType()
Description copied from interface:ScenarioPerturbationReturns the market data type that the perturbation changes.- Specified by:
getMarketDataTypein 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:
metaBeanin 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
-
-