Class HullWhiteOneFactorPiecewiseConstantParameters
- java.lang.Object
-
- com.opengamma.strata.pricer.model.HullWhiteOneFactorPiecewiseConstantParameters
-
- All Implemented Interfaces:
Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class HullWhiteOneFactorPiecewiseConstantParameters extends Object implements org.joda.beans.ImmutableBean, Serializable
Data bundle related to the Hull-White one factor (extended Vasicek) model with piecewise constant volatility.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
double
getLastVolatility()
Gets the last volatility of the volatility parameters.double
getMeanReversion()
Gets the mean reversion speed parameter.DoubleArray
getVolatility()
Gets the volatility parameters.DoubleArray
getVolatilityTime()
Gets the times separating the constant volatility periods.int
hashCode()
static org.joda.beans.TypedMetaBean<HullWhiteOneFactorPiecewiseConstantParameters>
meta()
The meta-bean forHullWhiteOneFactorPiecewiseConstantParameters
.org.joda.beans.TypedMetaBean<HullWhiteOneFactorPiecewiseConstantParameters>
metaBean()
static HullWhiteOneFactorPiecewiseConstantParameters
of(double meanReversion, DoubleArray volatility, DoubleArray volatilityTime)
Obtains an instance from the model parameters.String
toString()
HullWhiteOneFactorPiecewiseConstantParameters
withLastVolatility(double volatility)
Returns a copy with the last volatility of the volatility parameters changed.HullWhiteOneFactorPiecewiseConstantParameters
withVolatility(DoubleArray volatility)
Returns a copy with the volatility parameters changed.HullWhiteOneFactorPiecewiseConstantParameters
withVolatilityAdded(double volatility, double volatilityTime)
Returns a copy with an extra volatility and volatility time added at the end of the respective arrays.
-
-
-
Method Detail
-
of
public static HullWhiteOneFactorPiecewiseConstantParameters of(double meanReversion, DoubleArray volatility, DoubleArray volatilityTime)
Obtains an instance from the model parameters.volatilityTime
should be sorted in increasing order. The first time (0) and the last time (1000) will be added within this method. Thus the size ofvolatility
should be greater than that ofvolatilityTime
by one.- Parameters:
meanReversion
- the mean reversion speed (a) parametervolatility
- the volatility parametersvolatilityTime
- the times separating the constant volatility periods- Returns:
- the instance
-
withVolatility
public HullWhiteOneFactorPiecewiseConstantParameters withVolatility(DoubleArray volatility)
Returns a copy with the volatility parameters changed.- Parameters:
volatility
- the new volatility parameters- Returns:
- the new instance
-
getLastVolatility
public double getLastVolatility()
Gets the last volatility of the volatility parameters.- Returns:
- the last volatility
-
withLastVolatility
public HullWhiteOneFactorPiecewiseConstantParameters withLastVolatility(double volatility)
Returns a copy with the last volatility of the volatility parameters changed.- Parameters:
volatility
- the new volatility- Returns:
- the new instance
-
withVolatilityAdded
public HullWhiteOneFactorPiecewiseConstantParameters withVolatilityAdded(double volatility, double volatilityTime)
Returns a copy with an extra volatility and volatility time added at the end of the respective arrays.- Parameters:
volatility
- the volatilityvolatilityTime
- the times separating the constant volatility periods. Must be larger than the previous one- Returns:
- the new instance
-
meta
public static org.joda.beans.TypedMetaBean<HullWhiteOneFactorPiecewiseConstantParameters> meta()
The meta-bean forHullWhiteOneFactorPiecewiseConstantParameters
.- Returns:
- the meta-bean, not null
-
metaBean
public org.joda.beans.TypedMetaBean<HullWhiteOneFactorPiecewiseConstantParameters> metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getMeanReversion
public double getMeanReversion()
Gets the mean reversion speed parameter.- Returns:
- the value of the property, not null
-
getVolatility
public DoubleArray getVolatility()
Gets the volatility parameters.The volatility is constant between the volatility times, i.e., volatility value at t is
volatility.get(i)
for any t betweenvolatilityTime.get(i)
andvolatilityTime.get(i+1)
.- Returns:
- the value of the property, not null
-
getVolatilityTime
public DoubleArray getVolatilityTime()
Gets the times separating the constant volatility periods.The time should be sorted by increasing order. The first time is 0 and the last time is 1000 (represents infinity). These extra times are added in
of(double, DoubleArray, DoubleArray)
.- Returns:
- the value of the property, not null
-
-