Module net.finmath.lib
Class SwaptionFromSwapSchedules
java.lang.Object
net.finmath.montecarlo.AbstractMonteCarloProduct
net.finmath.montecarlo.interestrate.products.AbstractTermStructureMonteCarloProduct
net.finmath.montecarlo.interestrate.products.SwaptionFromSwapSchedules
- All Implemented Interfaces:
Product
,Swaption
,TermStructureMonteCarloProduct
,MonteCarloProduct
,ProcessTimeDiscretizationProvider
public class SwaptionFromSwapSchedules
extends AbstractTermStructureMonteCarloProduct
implements ProcessTimeDiscretizationProvider, Swaption
Implementation of a Monte-Carlo valuation of a swaption valuation being compatible with AAD.
The valuation internally uses an analytic valuation of a swap such that the
getValue(double, TermStructureMonteCarloSimulationModel)
method
returns an valuation being \( \mathcal{F}_{t} \}-measurable where \( t \) is the evaluationTime argument.- Author:
- Christian Fries
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.finmath.modelling.products.Swaption
Swaption.ValueUnit
-
Constructor Summary
ConstructorsConstructorDescriptionSwaptionFromSwapSchedules(LocalDateTime referenceDate, SwaptionFromSwapSchedules.SwaptionType swaptionType, LocalDate exerciseDate, Schedule scheduleFixedLeg, Schedule scheduleFloatLeg, double swaprate, double notional, Swaption.ValueUnit valueUnit)
-
Method Summary
Modifier and TypeMethodDescriptiongetProcessTimeDiscretization(LocalDateTime referenceDate)
Returns a suggestion for a time discretization which is suited (or required) for the processing (e.g valuation) of this object.getValue(double evaluationTime, TermStructureMonteCarloSimulationModel model)
This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.static RandomVariable
getValueOfLegAnalytic(double evaluationTime, TermStructureMonteCarloSimulationModel model, Schedule schedule, boolean paysFloatingRate, double fixRate, double notional)
Determines the time \( t \)-measurable value of a swap leg (can handle fix or float).toString()
Methods inherited from class net.finmath.montecarlo.interestrate.products.AbstractTermStructureMonteCarloProduct
getFactorDrift, getValue, getValueForModifiedData, getValues
Methods inherited from class net.finmath.montecarlo.AbstractMonteCarloProduct
getCurrency, getValue, getValue, getValues, getValues, getValues, getValuesForModifiedData, getValuesForModifiedData, getValuesForModifiedData, getValuesForModifiedData
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.finmath.montecarlo.MonteCarloProduct
getCurrency, getValue, getValue, getValues, getValues, getValues, getValuesForModifiedData, getValuesForModifiedData, getValuesForModifiedData, getValuesForModifiedData
-
Constructor Details
-
SwaptionFromSwapSchedules
public SwaptionFromSwapSchedules(LocalDateTime referenceDate, SwaptionFromSwapSchedules.SwaptionType swaptionType, LocalDate exerciseDate, Schedule scheduleFixedLeg, Schedule scheduleFloatLeg, double swaprate, double notional, Swaption.ValueUnit valueUnit)
-
-
Method Details
-
getValue
public RandomVariable getValue(double evaluationTime, TermStructureMonteCarloSimulationModel model) throws CalculationExceptionDescription copied from interface:TermStructureMonteCarloProduct
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:
getValue
in interfaceTermStructureMonteCarloProduct
- Specified by:
getValue
in 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.
-
getProcessTimeDiscretization
Description copied from interface:ProcessTimeDiscretizationProvider
Returns a suggestion for a time discretization which is suited (or required) for the processing (e.g valuation) of this object.- Specified by:
getProcessTimeDiscretization
in interfaceProcessTimeDiscretizationProvider
- Parameters:
referenceDate
- A reference date relative to which the discretization is generated.- Returns:
- A time discretization.
-
getExerciseDate
- Returns:
- the exercise date
-
getValueOfLegAnalytic
public static RandomVariable getValueOfLegAnalytic(double evaluationTime, TermStructureMonteCarloSimulationModel model, Schedule schedule, boolean paysFloatingRate, double fixRate, double notional) throws CalculationExceptionDetermines the time \( t \)-measurable value of a swap leg (can handle fix or float).- Parameters:
evaluationTime
- The time \( t \) conditional to which the value is calculated.model
- The model implmeneting LIBORModelMonteCarloSimulationModel.schedule
- The schedule of the leg.paysFloatingRate
- If true, the leg will payTermStructureMonteCarloSimulationModel.getForwardRate(double, double, double)
fixRate
- The fixed rate (if any)notional
- The notional- Returns:
- The time \( t \)-measurable value
- Throws:
CalculationException
- Thrown is model failed to provide the required quantities.
-
toString
- Overrides:
toString
in classAbstractMonteCarloProduct
-