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 booleanequals(Object obj)doublegetLastVolatility()Gets the last volatility of the volatility parameters.doublegetMeanReversion()Gets the mean reversion speed parameter.DoubleArraygetVolatility()Gets the volatility parameters.DoubleArraygetVolatilityTime()Gets the times separating the constant volatility periods.inthashCode()static org.joda.beans.TypedMetaBean<HullWhiteOneFactorPiecewiseConstantParameters>meta()The meta-bean forHullWhiteOneFactorPiecewiseConstantParameters.org.joda.beans.TypedMetaBean<HullWhiteOneFactorPiecewiseConstantParameters>metaBean()static HullWhiteOneFactorPiecewiseConstantParametersof(double meanReversion, DoubleArray volatility, DoubleArray volatilityTime)Obtains an instance from the model parameters.StringtoString()HullWhiteOneFactorPiecewiseConstantParameterswithLastVolatility(double volatility)Returns a copy with the last volatility of the volatility parameters changed.HullWhiteOneFactorPiecewiseConstantParameterswithVolatility(DoubleArray volatility)Returns a copy with the volatility parameters changed.HullWhiteOneFactorPiecewiseConstantParameterswithVolatilityAdded(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.volatilityTimeshould be sorted in increasing order. The first time (0) and the last time (1000) will be added within this method. Thus the size ofvolatilityshould be greater than that ofvolatilityTimeby 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:
metaBeanin 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
-
-