Class SwapAnnuity

All Implemented Interfaces:
AnalyticProduct, Product

public class SwapAnnuity extends AbstractAnalyticProduct implements AnalyticProduct
Implements the valuation of a swap annuity using curves (discount curve). Support for day counting is limited to the capabilities of TimeDiscretization.
Version:
1.0
Author:
Christian Fries
  • Constructor Details

    • SwapAnnuity

      public SwapAnnuity(Schedule schedule, String discountCurveName)
      Creates a swap annuity for a given schedule and discount curve.
      Parameters:
      schedule - TenorFromArray of the swap annuity.
      discountCurveName - Name of the discount curve for the swap annuity.
  • Method Details

    • getValue

      public double getValue(double evaluationTime, AnalyticModel model)
      Description copied from interface: AnalyticProduct
      Return the valuation of the product using the given model. The model has to implement the modes of AnalyticModel.
      Specified by:
      getValue in interface AnalyticProduct
      Parameters:
      evaluationTime - The evaluation time as double. Cash flows prior and including this time are not considered.
      model - The model under which the product is valued.
      Returns:
      The value of the product using the given model.
    • getSwapAnnuity

      public static double getSwapAnnuity(TimeDiscretization tenor, DiscountCurve discountCurve)
      Function to calculate an (idealized) swap annuity for a given schedule and discount curve.
      Parameters:
      tenor - The schedule discretization, i.e., the period start and end dates. End dates are considered payment dates and start of the next period.
      discountCurve - The discount curve.
      Returns:
      The swap annuity.
    • getSwapAnnuity

      public static double getSwapAnnuity(TimeDiscretization tenor, ForwardCurve forwardCurve)
      Function to calculate an (idealized) single curve swap annuity for a given schedule and forward curve. The discount curve used to calculate the annuity is calculated from the forward curve using classical single curve interpretations of forwards and a default period length. The may be a crude approximation.
      Parameters:
      tenor - The schedule discretization, i.e., the period start and end dates. End dates are considered payment dates and start of the next period.
      forwardCurve - The forward curve.
      Returns:
      The swap annuity.
    • getSwapAnnuity

      public static double getSwapAnnuity(Schedule schedule, DiscountCurve discountCurve)
      Function to calculate an (idealized) swap annuity for a given schedule and discount curve. Note: This method will consider evaluationTime being 0, see getSwapAnnuity(double, Schedule, DiscountCurve, AnalyticModel).
      Parameters:
      schedule - The schedule discretization, i.e., the period start and end dates. End dates are considered payment dates and start of the next period.
      discountCurve - The discount curve.
      Returns:
      The swap annuity.
    • getSwapAnnuity

      public static double getSwapAnnuity(Schedule schedule, ForwardCurve forwardCurve)
      Function to calculate an (idealized) single curve swap annuity for a given schedule and forward curve. The discount curve used to calculate the annuity is calculated from the forward curve using classical single curve interpretations of forwards and a default period length. The may be a crude approximation. Note: This method will consider evaluationTime being 0, see getSwapAnnuity(double, Schedule, DiscountCurve, AnalyticModel).
      Parameters:
      schedule - The schedule discretization, i.e., the period start and end dates. End dates are considered payment dates and start of the next period.
      forwardCurve - The forward curve.
      Returns:
      The swap annuity.
    • getSwapAnnuity

      public static double getSwapAnnuity(double evaluationTime, Schedule schedule, DiscountCurve discountCurve, AnalyticModel model)
      Function to calculate an (idealized) swap annuity for a given schedule and discount curve. Note that, the value returned is divided by the discount factor at evaluation. This matters, if the discount factor at evaluationTime is not equal to 1.0.
      Parameters:
      evaluationTime - The evaluation time as double. Cash flows prior and including this time are not considered.
      schedule - The schedule discretization, i.e., the period start and end dates. End dates are considered payment dates and start of the next period.
      discountCurve - The discount curve.
      model - The model, needed only in case the discount curve evaluation depends on an additional curve.
      Returns:
      The swap annuity.
    • toString

      public String toString()
      Overrides:
      toString in class Object