finMath lib documentation
net.finmath.marketdata.products

## Class SwapAnnuity

• All Implemented Interfaces:
AnalyticProductInterface, ProductInterface

public class SwapAnnuity
extends AbstractAnalyticProduct
implements AnalyticProductInterface
Implements the valuation of a swap annuity using curves (discount curve). Support for day counting is limited to the capabilities of TimeDiscretizationInterface.
Author:
Christian Fries
• ### Constructor Summary

Constructors
Constructor and Description
SwapAnnuity(ScheduleInterface schedule, String discountCurveName)
Creates a swap annuity for a given schedule and discount curve.
• ### Method Summary

All Methods
Modifier and Type Method and Description
static double getSwapAnnuity(double evaluationTime, ScheduleInterface schedule, DiscountCurveInterface discountCurve, AnalyticModelInterface model)
Function to calculate an (idealized) swap annuity for a given schedule and discount curve.
static double getSwapAnnuity(ScheduleInterface schedule, DiscountCurveInterface discountCurve)
Function to calculate an (idealized) swap annuity for a given schedule and discount curve.
static double getSwapAnnuity(ScheduleInterface schedule, ForwardCurveInterface forwardCurve)
Function to calculate an (idealized) single curve swap annuity for a given schedule and forward curve.
static double getSwapAnnuity(TimeDiscretizationInterface tenor, DiscountCurveInterface discountCurve)
Function to calculate an (idealized) swap annuity for a given schedule and discount curve.
static double getSwapAnnuity(TimeDiscretizationInterface tenor, ForwardCurveInterface forwardCurve)
Function to calculate an (idealized) single curve swap annuity for a given schedule and forward curve.
double getValue(double evaluationTime, AnalyticModelInterface model)
Return the valuation of the product using the given model.
String toString()
• ### Methods inherited from class net.finmath.marketdata.products.AbstractAnalyticProduct

getValue, getValue
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
• ### Methods inherited from interface net.finmath.modelling.ProductInterface

getValue
• ### Constructor Detail

• #### SwapAnnuity

public SwapAnnuity(ScheduleInterface schedule,
String discountCurveName)
Creates a swap annuity for a given schedule and discount curve.
Parameters:
schedule - Tenor of the swap annuity.
discountCurveName - Name of the discount curve for the swap annuity.
• ### Method Detail

• #### getValue

public double getValue(double evaluationTime,
AnalyticModelInterface model)
Description copied from interface: AnalyticProductInterface
Return the valuation of the product using the given model. The model has to implement the modes of AnalyticModelInterface.
Specified by:
getValue in interface AnalyticProductInterface
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(TimeDiscretizationInterface tenor,
DiscountCurveInterface 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(TimeDiscretizationInterface tenor,
ForwardCurveInterface 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(ScheduleInterface schedule,
DiscountCurveInterface 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, ScheduleInterface, DiscountCurveInterface, AnalyticModelInterface).
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(ScheduleInterface schedule,
ForwardCurveInterface 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, ScheduleInterface, DiscountCurveInterface, AnalyticModelInterface).
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,
ScheduleInterface schedule,
DiscountCurveInterface discountCurve,
AnalyticModelInterface 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