public final class CurveParallelShifts extends Object implements ScenarioPerturbation<Curve>, org.joda.beans.ImmutableBean, Serializable
The shift can be absolute or relative. An absolute shift adds the shift amount to each point on the curve. A relative shift applies a scaling to each point on the curve.
For example, a relative shift of 0.1 (10%) multiplies each value on the curve by 1.1, and a shift of -0.2 (-20%)
multiplies the value by 0.8. So for relative shifts the shifted value is (value x (1 + shift)).
| Modifier and Type | Class and Description |
|---|---|
static class |
CurveParallelShifts.Meta
The meta-bean for
CurveParallelShifts. |
| Modifier and Type | Method and Description |
|---|---|
static CurveParallelShifts |
absolute(double... shiftAmounts)
Creates a shift that adds a fixed amount to the value at every node in the curve.
|
MarketDataBox<Curve> |
applyTo(MarketDataBox<Curve> curve,
ReferenceData refData) |
boolean |
equals(Object obj) |
Class<Curve> |
getMarketDataType() |
int |
getScenarioCount() |
DoubleArray |
getShiftAmounts()
Gets the amount by which the y-values are shifted.
|
ShiftType |
getShiftType()
Gets the type of shift to apply to the y-values of the curve.
|
int |
hashCode() |
static CurveParallelShifts.Meta |
meta()
The meta-bean for
CurveParallelShifts. |
CurveParallelShifts.Meta |
metaBean() |
static CurveParallelShifts |
relative(double... shiftAmounts)
Creates a shift that multiplies the values at each curve node by a scaling factor.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitnonepublic static CurveParallelShifts absolute(double... shiftAmounts)
shiftAmounts - the amount to add to each node value in the curvepublic static CurveParallelShifts relative(double... shiftAmounts)
The shift amount is a decimal percentage. For example, a shift amount of 0.1 is a shift of +10% which multiplies the value by 1.1. A shift amount of -0.2 is a shift of -20% which multiplies the value by 0.8.
shiftAmounts - the factor to multiply the value at each curve node bypublic MarketDataBox<Curve> applyTo(MarketDataBox<Curve> curve, ReferenceData refData)
applyTo in interface ScenarioPerturbation<Curve>public int getScenarioCount()
getScenarioCount in interface ScenarioPerturbation<Curve>public Class<Curve> getMarketDataType()
getMarketDataType in interface ScenarioPerturbation<Curve>public static CurveParallelShifts.Meta meta()
CurveParallelShifts.public CurveParallelShifts.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic ShiftType getShiftType()
public DoubleArray getShiftAmounts()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.