public final class CrossGammaParameterSensitivity extends Object implements FxConvertible<CrossGammaParameterSensitivity>, org.joda.beans.ImmutableBean, Serializable
Parameter sensitivity is the sensitivity of a value to the parameters of a
parameterized market data object that is used to determine the value.
The main application of this class is the parameter sensitivities for curves.
Thus ParameterizedData is typically Curve.
The sensitivity is expressed as a matrix.
The (i,j) component is the sensitivity of the i-th component of the parameterMetadata delta to
the j-th parameter in order.
The sensitivity represents a monetary value in the specified currency.
| Modifier and Type | Class and Description |
|---|---|
static class |
CrossGammaParameterSensitivity.Meta
The meta-bean for
CrossGammaParameterSensitivity. |
| Modifier and Type | Method and Description |
|---|---|
int |
compareKey(CrossGammaParameterSensitivity other)
Compares the key of two sensitivity objects, excluding the parameter sensitivity values.
|
CrossGammaParameterSensitivity |
convertedTo(Currency resultCurrency,
FxRateProvider rateProvider)
Converts this sensitivity to an equivalent in the specified currency.
|
CurrencyParameterSensitivity |
diagonal()
Returns the diagonal part of the sensitivity as
CurrencyParameterSensitivity. |
boolean |
equals(Object obj) |
Currency |
getCurrency()
Gets the currency of the sensitivity.
|
MarketDataName<?> |
getMarketDataName()
Gets the market data name.
|
ImmutableList<Pair<MarketDataName<?>,List<? extends ParameterMetadata>>> |
getOrder()
Gets the sensitivity order.
|
int |
getParameterCount()
Gets the number of parameters.
|
ImmutableList<ParameterMetadata> |
getParameterMetadata()
Gets the list of parameter metadata.
|
ParameterMetadata |
getParameterMetadata(int parameterIndex)
Gets the parameter metadata at the specified index.
|
DoubleMatrix |
getSensitivity()
Gets the parameter sensitivity values.
|
CrossGammaParameterSensitivity |
getSensitivity(MarketDataName<?> name)
Returns the sensitivity to the market data specified by
name. |
int |
hashCode() |
CrossGammaParameterSensitivity |
mapSensitivity(DoubleUnaryOperator operator)
Returns an instance with the specified operation applied to the sensitivity values.
|
static CrossGammaParameterSensitivity.Meta |
meta()
The meta-bean for
CrossGammaParameterSensitivity. |
CrossGammaParameterSensitivity.Meta |
metaBean() |
CrossGammaParameterSensitivity |
multipliedBy(double factor)
Returns an instance with the sensitivity values multiplied by the specified factor.
|
static CrossGammaParameterSensitivity |
of(MarketDataName<?> marketDataName,
List<? extends ParameterMetadata> parameterMetadata,
Currency currency,
DoubleMatrix sensitivity)
Obtains an instance from the market data name, metadata, currency and sensitivity.
|
static CrossGammaParameterSensitivity |
of(MarketDataName<?> marketDataName,
List<? extends ParameterMetadata> parameterMetadata,
List<Pair<MarketDataName<?>,List<? extends ParameterMetadata>>> order,
Currency currency,
DoubleMatrix sensitivity)
Obtains an instance from the market data names, metadatas, currency and sensitivity.
|
static CrossGammaParameterSensitivity |
of(MarketDataName<?> marketDataName,
List<? extends ParameterMetadata> parameterMetadata,
MarketDataName<?> marketDataNameOther,
List<? extends ParameterMetadata> parameterMetadataOther,
Currency currency,
DoubleMatrix sensitivity)
Obtains an instance from the market data names, metadatas, currency and sensitivity.
|
String |
toString() |
CurrencyAmount |
total()
Returns the total of the sensitivity values.
|
CrossGammaParameterSensitivity |
withSensitivity(DoubleMatrix sensitivity)
Returns an instance with new parameter sensitivity values.
|
public static CrossGammaParameterSensitivity of(MarketDataName<?> marketDataName, List<? extends ParameterMetadata> parameterMetadata, Currency currency, DoubleMatrix sensitivity)
This creates a sensitivity instance which stores the second order sensitivity values to a single market data, i.e., the block diagonal part of the full second order sensitivity matrix.
The market data name identifies the ParameterizedData instance that was queried.
The parameter metadata provides information on each parameter.
The size of the parameter metadata list must match the size of the sensitivity array.
marketDataName - the name of the market data that the sensitivity refers toparameterMetadata - the parameter metadatacurrency - the currency of the sensitivitysensitivity - the sensitivity values, one for each parameterpublic static CrossGammaParameterSensitivity of(MarketDataName<?> marketDataName, List<? extends ParameterMetadata> parameterMetadata, MarketDataName<?> marketDataNameOther, List<? extends ParameterMetadata> parameterMetadataOther, Currency currency, DoubleMatrix sensitivity)
This creates a sensitivity instance which stores the second order sensitivity values: the delta of a market data to another market data. The first market data and the second market data can be the same.
The market data name identifies the ParameterizedData instance that was queried.
The parameter metadata provides information on each parameter.
marketDataName - the name of the first market data that the sensitivity refers toparameterMetadata - the first parameter metadatamarketDataNameOther - the name of the second market data that the sensitivity refers toparameterMetadataOther - the second parameter metadatacurrency - the currency of the sensitivitysensitivity - the sensitivity values, one for each parameterpublic static CrossGammaParameterSensitivity of(MarketDataName<?> marketDataName, List<? extends ParameterMetadata> parameterMetadata, List<Pair<MarketDataName<?>,List<? extends ParameterMetadata>>> order, Currency currency, DoubleMatrix sensitivity)
This creates a sensitivity instance which stores the second order sensitivity values: the delta of a market data
to a set of other market data.
The market data set is represented in terms of List<Pair<MarketDataName<?>, List<? extends ParameterMetadata>>>.
which defines the order of the sensitivity values.
The market data name identifies the ParameterizedData instance that was queried.
The parameter metadata provides information on each parameter.
marketDataName - the name of the market data that the sensitivity refers toparameterMetadata - the parameter metadataorder - the ordercurrency - the currency of the sensitivitysensitivity - the sensitivity values, one for each parameterpublic int getParameterCount()
This returns the number of parameters in the ParameterizedData instance
which is the same size as the sensitivity array.
public ParameterMetadata getParameterMetadata(int parameterIndex)
If there is no specific parameter metadata, an empty instance will be returned.
parameterIndex - the zero-based index of the parameter to getIndexOutOfBoundsException - if the index is invalidpublic int compareKey(CrossGammaParameterSensitivity other)
other - the other sensitivity objectpublic CrossGammaParameterSensitivity convertedTo(Currency resultCurrency, FxRateProvider rateProvider)
Any FX conversion that is required will use rates from the provider.
convertedTo in interface FxConvertible<CrossGammaParameterSensitivity>resultCurrency - the currency of the resultrateProvider - the provider of FX ratesRuntimeException - if no FX rate could be foundpublic CrossGammaParameterSensitivity multipliedBy(double factor)
Each value in the sensitivity array will be multiplied by the factor.
factor - the multiplicative factorpublic CrossGammaParameterSensitivity mapSensitivity(DoubleUnaryOperator operator)
Each value in the sensitivity array will be operated on. For example, the operator could multiply the sensitivities by a constant, or take the inverse.
inverse = base.mapSensitivity(value -> 1 / value);
operator - the operator to be applied to the sensitivitiespublic CrossGammaParameterSensitivity withSensitivity(DoubleMatrix sensitivity)
sensitivity - the new sensitivity valuespublic CurrencyAmount total()
public CurrencyParameterSensitivity diagonal()
CurrencyParameterSensitivity.public CrossGammaParameterSensitivity getSensitivity(MarketDataName<?> name)
name.
This returns a sensitivity instance which stores the sensitivity of the marketDataName delta to another
market data of name.
name - the nameIllegalArgumentException - if the name does not match an entrypublic static CrossGammaParameterSensitivity.Meta meta()
CrossGammaParameterSensitivity.public CrossGammaParameterSensitivity.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic MarketDataName<?> getMarketDataName()
This name is used in the market data system to identify the data that the sensitivities refer to.
public ImmutableList<ParameterMetadata> getParameterMetadata()
There is one entry for each parameter.
public ImmutableList<Pair<MarketDataName<?>,List<? extends ParameterMetadata>>> getOrder()
This defines the order of sensitivity values, which can be used as a key to interpret sensitivity.
public Currency getCurrency()
public DoubleMatrix getSensitivity()
The curve delta sensitivities to parameterized market data.
This is a n x m matrix, where n must agree with the size of parameterMetadata and
m must be the sum of parameter count in order.
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.