Class ForwardCurveFromDiscountCurve

  • All Implemented Interfaces:
    Serializable, Cloneable, ParameterObject, Curve, ForwardCurveInterface

    public class ForwardCurveFromDiscountCurve
    extends AbstractForwardCurve
    implements Serializable
    A forward curve derived from a given discount curve. The forward with fixing in \( t \) is calculated as \( (\frac{1}{dcf(t,t+d)} ( \frac{df(t)}{df(t+d)}-1 ) \) where \( dcf(t,t+d) \) is the daycount-fraction between t and t+d and \( t \mapsto df(t) \) is the given referenceDiscountCurveNameForForwardCurve. The payment offset \( t+d \) is either generated from the paymentOffsetCode or directly specified if paymentOffsetCode=NaN. The referenceDiscountCurveNameForForwardCurve is referenced by name and evaluated late (which allows use of this construct in a calibration process referencing changing discount curves.
    Version:
    1.0
    Author:
    Christian Fries
    See Also:
    Serialized Form
    • Constructor Detail

      • ForwardCurveFromDiscountCurve

        public ForwardCurveFromDiscountCurve​(String name,
                                             String referenceDiscountCurveName,
                                             String discountCurveName,
                                             LocalDate referenceDate,
                                             String paymentOffsetCode,
                                             BusinessdayCalendar paymentOffsetBusinessdayCalendar,
                                             BusinessdayCalendar.DateRollConvention paymentOffsetDateRollConvention,
                                             double daycountScaling,
                                             double periodOffset)
        Create a forward curve using a given referenceDiscountCurveForForwards.
        Parameters:
        name - The name under which the forward curve can be referenced.
        referenceDiscountCurveName - The (pseudo-)discount curve that the forwards are calculated from.
        discountCurveName - The name of the discount curve associated with this forward curve (usually OIS).
        referenceDate - The reference date used in the interpretation of times (i.e., the referenceDate where t=0).
        paymentOffsetCode - The payment offset. If null, the parameter p has to be provided to the getForward method.
        paymentOffsetBusinessdayCalendar - The calendar used to generate the payment date from the paymentOffetCode.
        paymentOffsetDateRollConvention - The date roll convention used to generate the payment date from the paymentOffsetCode.
        daycountScaling - The scaling factor applied to the paymentOffset measured in ACT/365.
        periodOffset - An offset in ACT/365 applied to the fixing to construct the period start (the negative of the fixingOffset of the period).
      • ForwardCurveFromDiscountCurve

        public ForwardCurveFromDiscountCurve​(String name,
                                             String referenceDiscountCurveName,
                                             LocalDate referenceDate,
                                             String paymentOffsetCode,
                                             BusinessdayCalendar paymentOffsetBusinessdayCalendar,
                                             BusinessdayCalendar.DateRollConvention paymentOffsetDateRollConvention,
                                             double daycountScaling,
                                             double periodOffset)
        Create a forward curve using a given referenceDiscountCurveForForwards. Note that the referenceDiscountCurveForForwards is also used as the discount curve associated with the forwards (i.e. single curve).
        Parameters:
        name - The name under which the forward curve can be referenced.
        referenceDiscountCurveName - The (pseudo-)discount curve that the forwards are calculated from.
        referenceDate - The reference date used in the interpretation of times (i.e., the referenceDate where t=0).
        paymentOffsetCode - The payment offset. If null, the parameter p has to be provided to the getForward method.
        paymentOffsetBusinessdayCalendar - The calendar used to generate the payment date from the paymentOffetCode.
        paymentOffsetDateRollConvention - The date roll convention used to generate the payment date from the paymentOffsetCode.
        daycountScaling - The scaling factor applied to the paymentOffset measured in ACT/365.
        periodOffset - An offset in ACT/365 applied to the fixing to construct the period start (the negative of the fixingOffset of the period).
      • ForwardCurveFromDiscountCurve

        public ForwardCurveFromDiscountCurve​(String name,
                                             String referenceDiscountCurveName,
                                             LocalDate referenceDate,
                                             String paymentOffsetCode,
                                             BusinessdayCalendar paymentOffsetBusinessdayCalendar,
                                             BusinessdayCalendar.DateRollConvention paymentOffsetDateRollConvention)
        Create a forward curve using a given referenceDiscountCurveForForwards. Note that the referenceDiscountCurveForForwards is also used as the discount curve associated with the forwards (i.e. single curve).
        Parameters:
        name - The name under which the forward curve can be referenced.
        referenceDiscountCurveName - The (pseudo-)discount curve that the forwards are calculated from.
        referenceDate - The reference date used in the interpretation of times (i.e., the referenceDate where t=0).
        paymentOffsetCode - The payment offset. If null, the parameter p has to be provided to the getForward method.
        paymentOffsetBusinessdayCalendar - The calendar used to generate the payment date from the paymentOffetCode.
        paymentOffsetDateRollConvention - The date roll convention used to generate the payment date from the paymentOffsetCode.
      • ForwardCurveFromDiscountCurve

        public ForwardCurveFromDiscountCurve​(String name,
                                             String referenceDiscountCurveName,
                                             LocalDate referenceDate,
                                             String paymentOffsetCode)
        Create a forward curve using a given referenceDiscountCurveForForwards. Note that the referenceDiscountCurveForForwards is also used as the discount curve associated with the forwards (i.e. single curve).
        Parameters:
        name - The name under which the forward curve can be referenced.
        referenceDiscountCurveName - The (pseudo-)discount curve that the forwards are calculated from.
        referenceDate - The reference date used in the interpretation of times (i.e., the referenceDate where t=0).
        paymentOffsetCode - The payment offset. If null, the parameter p has to be provided to the getForward method.
      • ForwardCurveFromDiscountCurve

        public ForwardCurveFromDiscountCurve​(String referenceDiscountCurveName,
                                             LocalDate referenceDate,
                                             String paymentOffsetCode)
        Create a forward curve using a given referenceDiscountCurveForForwards. Note that the referenceDiscountCurveForForwards is also used as the discount curve associated with the forwards (i.e. single curve). The name of the this forward curve will be "ForwardCurveFromDiscountCurve(" + referenceDiscountCurveName + "," + paymentOffsetCode + ")", but code should not reply on this. Instead you should use getName() to get the name of the curve.
        Parameters:
        referenceDiscountCurveName - The (pseudo-)discount curve that the forwards are calculated from.
        referenceDate - The reference date used in the interpretation of times (i.e., the referenceDate where t=0).
        paymentOffsetCode - The payment offset. If null, the parameter p has to be provided to the getForward method.
    • Method Detail

      • getForward

        public RandomVariable getForward​(AnalyticModel model,
                                         double fixingTime)
        Description copied from interface: ForwardCurveInterface
        Returns the forward for the corresponding fixing time.
        Specified by:
        getForward in interface ForwardCurveInterface
        Parameters:
        model - An analytic model providing a context. Some curves do not need this (can be null).
        fixingTime - The fixing time of the index associated with this forward curve.
        Returns:
        The forward.
      • getForward

        public RandomVariable getForward​(AnalyticModel model,
                                         double fixingTime,
                                         double paymentOffset)
        Description copied from interface: ForwardCurveInterface
        Returns the forward for the corresponding fixing time and paymentOffset.
        Specified by:
        getForward in interface ForwardCurveInterface
        Parameters:
        model - An analytic model providing a context. Some curves do not need this (can be null).
        fixingTime - The fixing time of the index associated with this forward curve.
        paymentOffset - The payment offset (as internal day count fraction) specifying the payment of this index. Used only as a fallback and/or consistency check.
        Returns:
        The forward.
      • getValue

        public RandomVariable getValue​(double time)
        Description copied from interface: Curve
        Returns the value for the time using the interpolation method associated with this curve.
        Specified by:
        getValue in interface Curve
        Overrides:
        getValue in class CurveInterpolation
        Parameters:
        time - Time for which the value should be returned.
        Returns:
        The value at the give time.
      • getValue

        public RandomVariable getValue​(AnalyticModel model,
                                       double time)
        Description copied from interface: Curve
        Returns the value for the time using the interpolation method associated with this curve within a given context, i.e., a model. The model (context) is needed only if the curve relies on another curve. Examples are a forward curve which relies on a discount curve or a discount curve which is defined via a spread over another curve.
        Specified by:
        getValue in interface Curve
        Overrides:
        getValue in class CurveInterpolation
        Parameters:
        model - An analytic model providing a context.
        time - Time for which the value should be returned.
        Returns:
        The value at the give time.