Class HullWhiteOneFactorPiecewiseConstantParametersProvider
- java.lang.Object
-
- com.opengamma.strata.pricer.model.HullWhiteOneFactorPiecewiseConstantParametersProvider
-
- All Implemented Interfaces:
Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class HullWhiteOneFactorPiecewiseConstantParametersProvider extends Object implements org.joda.beans.ImmutableBean, Serializable
Hull-White one factor model with piecewise constant volatility.Reference: Henrard, M. "The Irony in the derivatives discounting Part II: the crisis", Wilmott Journal, 2010, 2, 301-316
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HullWhiteOneFactorPiecewiseConstantParametersProvider.Meta
The meta-bean forHullWhiteOneFactorPiecewiseConstantParametersProvider
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
alpha(LocalDate startDate, LocalDate endDate, LocalDate numeraireDate, LocalDate maturityDate)
Calculates the alpha value for the specified period with respect to the maturity date.ValueDerivatives
alphaAdjoint(LocalDate startDate, LocalDate endDate, LocalDate numeraireDate, LocalDate maturityDate)
Calculates the alpha and its derivative values for the specified period with respect to the maturity date.boolean
equals(Object obj)
double
futuresConvexityFactor(LocalDate referenceDate, LocalDate startDate, LocalDate endDate)
Calculates the future convexity factor for the specified period at the future reference date.ValueDerivatives
futuresConvexityFactorAdjoint(LocalDate referenceDate, LocalDate startDate, LocalDate endDate)
Calculates the future convexity factor and its derivative for the specified period at the future reference date.DayCount
getDayCount()
Gets the day count applicable to the model.HullWhiteOneFactorPiecewiseConstantInterestRateModel
getModel()
Returns a Hull-White one-factor model.HullWhiteOneFactorPiecewiseConstantParameters
getParameters()
Gets the Hull-White model parameters.ZonedDateTime
getValuationDateTime()
Gets the valuation date.int
hashCode()
static HullWhiteOneFactorPiecewiseConstantParametersProvider.Meta
meta()
The meta-bean forHullWhiteOneFactorPiecewiseConstantParametersProvider
.HullWhiteOneFactorPiecewiseConstantParametersProvider.Meta
metaBean()
static HullWhiteOneFactorPiecewiseConstantParametersProvider
of(HullWhiteOneFactorPiecewiseConstantParameters parameters, DayCount dayCount, LocalDate valuationDate, LocalTime valuationTime, ZoneId valuationZone)
Obtains an instance from Hull-White model parameters and the date, time and zone for which it is valid.static HullWhiteOneFactorPiecewiseConstantParametersProvider
of(HullWhiteOneFactorPiecewiseConstantParameters parameters, DayCount dayCount, ZonedDateTime valuationDateTime)
Obtains an instance from Hull-White model parameters and the date-time for which it is valid.double
relativeTime(LocalDate date)
Converts a date to a relative year fraction.String
toString()
-
-
-
Method Detail
-
of
public static HullWhiteOneFactorPiecewiseConstantParametersProvider of(HullWhiteOneFactorPiecewiseConstantParameters parameters, DayCount dayCount, ZonedDateTime valuationDateTime)
Obtains an instance from Hull-White model parameters and the date-time for which it is valid.- Parameters:
parameters
- the Hull-White model parametersdayCount
- the day count applicable to the modelvaluationDateTime
- the valuation date-time- Returns:
- the provider
-
of
public static HullWhiteOneFactorPiecewiseConstantParametersProvider of(HullWhiteOneFactorPiecewiseConstantParameters parameters, DayCount dayCount, LocalDate valuationDate, LocalTime valuationTime, ZoneId valuationZone)
Obtains an instance from Hull-White model parameters and the date, time and zone for which it is valid.- Parameters:
parameters
- the Hull-White model parametersdayCount
- the day count applicable to the modelvaluationDate
- the valuation datevaluationTime
- the valuation timevaluationZone
- the valuation time zone- Returns:
- the provider
-
futuresConvexityFactor
public double futuresConvexityFactor(LocalDate referenceDate, LocalDate startDate, LocalDate endDate)
Calculates the future convexity factor for the specified period at the future reference date.- Parameters:
referenceDate
- the reference datestartDate
- the start date of the periodendDate
- the end date of the period- Returns:
- the convexity factor
-
futuresConvexityFactorAdjoint
public ValueDerivatives futuresConvexityFactorAdjoint(LocalDate referenceDate, LocalDate startDate, LocalDate endDate)
Calculates the future convexity factor and its derivative for the specified period at the future reference date.- Parameters:
referenceDate
- the reference datestartDate
- the start date of the periodendDate
- the end date of the period- Returns:
- the convexity factor
-
relativeTime
public double relativeTime(LocalDate date)
Converts a date to a relative year fraction.When the date is after the valuation date, the returned number is negative.
- Parameters:
date
- the date to find the relative year fraction of- Returns:
- the relative year fraction
-
alpha
public double alpha(LocalDate startDate, LocalDate endDate, LocalDate numeraireDate, LocalDate maturityDate)
Calculates the alpha value for the specified period with respect to the maturity date.The alpha is computed with a bond numeraire of
numeraireDate
.- Parameters:
startDate
- the start date of the periodendDate
- the end date of the periodnumeraireDate
- the numeraire datematurityDate
- the maturity date- Returns:
- the alpha
-
alphaAdjoint
public ValueDerivatives alphaAdjoint(LocalDate startDate, LocalDate endDate, LocalDate numeraireDate, LocalDate maturityDate)
Calculates the alpha and its derivative values for the specified period with respect to the maturity date.The alpha is computed with a bond numeraire of
numeraireDate
.- Parameters:
startDate
- the start date of the periodendDate
- the end date of the periodnumeraireDate
- the numeraire datematurityDate
- the maturity date- Returns:
- the alpha adjoint
-
getModel
public HullWhiteOneFactorPiecewiseConstantInterestRateModel getModel()
Returns a Hull-White one-factor model.- Returns:
- the model
-
meta
public static HullWhiteOneFactorPiecewiseConstantParametersProvider.Meta meta()
The meta-bean forHullWhiteOneFactorPiecewiseConstantParametersProvider
.- Returns:
- the meta-bean, not null
-
metaBean
public HullWhiteOneFactorPiecewiseConstantParametersProvider.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getParameters
public HullWhiteOneFactorPiecewiseConstantParameters getParameters()
Gets the Hull-White model parameters.- Returns:
- the value of the property, not null
-
getDayCount
public DayCount getDayCount()
Gets the day count applicable to the model.- Returns:
- the value of the property, not null
-
getValuationDateTime
public ZonedDateTime getValuationDateTime()
Gets the valuation date.The volatilities are calibrated for this date-time.
- Returns:
- the value of the property, not null
-
-