Interface ScenarioPerturbation<T>
-
- Type Parameters:
T- the type of the market data handled by the perturbation
- All Known Implementing Classes:
CurveParallelShifts,FxRateShifts,GenericDoubleShifts,PointShifts
public interface ScenarioPerturbation<T>A perturbation that can be applied to a market data box to create market data for use in one or more scenarios.A perturbation is used to change market data in some way. It applies to a single piece of data, such as a discount curve or volatility surface. For example, a 5 basis point parallel shift of a curve, or a 10% increase in the quoted price of a security.
Implementations must be immutable and thread-safe beans.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description MarketDataBox<T>applyTo(MarketDataBox<T> marketData, ReferenceData refData)Applies this perturbation to the market data in a box, returning a box containing new, modified data.Class<T>getMarketDataType()Returns the market data type that the perturbation changes.intgetScenarioCount()Returns the number of scenarios for which this perturbation generates data.static <T> ScenarioPerturbation<T>none()Returns an instance that does not perturb the input.
-
-
-
Method Detail
-
none
static <T> ScenarioPerturbation<T> none()
Returns an instance that does not perturb the input.This is useful for creating base scenarios where none of the market data is perturbed.
- Type Parameters:
T- the type of the market data handled by the perturbation- Returns:
- a perturbation that returns its input unchanged
-
applyTo
MarketDataBox<T> applyTo(MarketDataBox<T> marketData, ReferenceData refData)
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.
- Parameters:
marketData- the market data to perturbrefData- the reference data- Returns:
- new market data derived by applying the perturbation to the input data
- Throws:
RuntimeException- if unable to perform the perturbation
-
getScenarioCount
int getScenarioCount()
Returns the number of scenarios for which this perturbation generates data.- Returns:
- the number of scenarios for which this perturbation generates data
-
-