Class SwapAnnuity
java.lang.Object
net.finmath.montecarlo.AbstractMonteCarloProduct
net.finmath.montecarlo.interestrate.products.AbstractTermStructureMonteCarloProduct
net.finmath.montecarlo.interestrate.products.SwapAnnuity
- All Implemented Interfaces:
Product, TermStructureMonteCarloProduct, MonteCarloProduct
This class implements the valuation of a simple swap annuity, i.e.,
the \( \sum_{i=1}^{n} \delta_{i} P(T_{i}) \) where \( \delta_{i} \) are given weights (period length) and
\( T_{i} \) are given maturities.
- Version:
- 1.2
- Author:
- Christian Fries
-
Constructor Summary
ConstructorsConstructorDescriptionSwapAnnuity(double[] maturities, double[] periodLengths) SwapAnnuity(LocalDateTime referenceDate, double[] maturities, double[] periodLengths) Create a swap annuity with maturity \( T_{i} \) and period length \( \delta_{i} \).SwapAnnuity(TimeDiscretization timeDiscretization) Creates a swap annuity from a tenor discretization. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]double[]getValue(double evaluationTime, TermStructureMonteCarloSimulationModel model) This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.toString()Methods inherited from class AbstractTermStructureMonteCarloProduct
getFactorDrift, getValue, getValueForModifiedData, getValuesMethods inherited from class AbstractMonteCarloProduct
getCurrency, getValue, getValue, getValues, getValues, getValues, getValuesForModifiedData, getValuesForModifiedData, getValuesForModifiedData, getValuesForModifiedDataMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface MonteCarloProduct
getCurrency, getValue, getValue, getValues, getValues, getValues, getValuesForModifiedData, getValuesForModifiedData, getValuesForModifiedData, getValuesForModifiedData
-
Constructor Details
-
SwapAnnuity
Create a swap annuity with maturity \( T_{i} \) and period length \( \delta_{i} \). Here \( T_{i} \) is specified as a double offset to a given reference date \( t = 0 \).- Parameters:
referenceDate- The date corresponding to \( t = 0 \).maturities- The maturities given as doubles, following theFloatingpointDateconvention as offsets toreferenceDate.periodLengths- The period lengths (cash-flow weights).
-
SwapAnnuity
public SwapAnnuity(double[] maturities, double[] periodLengths) - Parameters:
maturities- The maturities given as double.periodLengths- The period lengths (cash-flow weights).
-
SwapAnnuity
Creates a swap annuity from a tenor discretization. Each time step is one weighted payment at the end of the step.- Parameters:
timeDiscretization- The payment tenor.
-
-
Method Details
-
getValue
public RandomVariable getValue(double evaluationTime, TermStructureMonteCarloSimulationModel model) throws CalculationException This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime. Note: For a lattice this is often the value conditional to evalutationTime, for a Monte-Carlo simulation this is the (sum of) value discounted to evaluation time. Cashflows prior evaluationTime are not considered.- Specified by:
getValuein interfaceTermStructureMonteCarloProduct- Specified by:
getValuein classAbstractTermStructureMonteCarloProduct- Parameters:
evaluationTime- The time on which this products value should be observed.model- The model used to price the product.- Returns:
- The random variable representing the value of the product discounted to evaluation time
- Throws:
CalculationException- Thrown if the valuation fails, specific cause may be available via thecause()method.
-
getReferenceDate
-
getMaturities
public double[] getMaturities()- Returns:
- Returns the maturities.
-
getPeriodLengths
public double[] getPeriodLengths()- Returns:
- Returns the period lengths (cash-flow weights).
-
toString
- Overrides:
toStringin classAbstractMonteCarloProduct
-