Module net.finmath.lib
Class SwaptionFromSwapSchedules
- java.lang.Object
-
- net.finmath.montecarlo.AbstractMonteCarloProduct
-
- net.finmath.montecarlo.interestrate.products.AbstractLIBORMonteCarloProduct
-
- net.finmath.montecarlo.interestrate.products.SwaptionFromSwapSchedules
-
- All Implemented Interfaces:
Product
,Swaption
,TermStructureMonteCarloProduct
,MonteCarloProduct
,ProcessTimeDiscretizationProvider
public class SwaptionFromSwapSchedules extends AbstractLIBORMonteCarloProduct 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 thegetValue(double, LIBORModelMonteCarloSimulationModel)
method returns an valuation being \( \mathcal{F}_{t} \}-measurable where \( t \) is the evaluationTime argument.- Author:
- Christian Fries
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SwaptionFromSwapSchedules.SwaptionType
-
Nested classes/interfaces inherited from interface net.finmath.modelling.products.Swaption
Swaption.ValueUnit
-
-
Constructor Summary
Constructors Constructor Description SwaptionFromSwapSchedules(LocalDateTime referenceDate, SwaptionFromSwapSchedules.SwaptionType swaptionType, LocalDate exerciseDate, Schedule scheduleFixedLeg, Schedule scheduleFloatLeg, double swaprate, double notional, Swaption.ValueUnit valueUnit)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LocalDate
getExerciseDate()
TimeDiscretization
getProcessTimeDiscretization(LocalDateTime referenceDate)
Returns a suggestion for a time discretization which is suited (or required) for the processing (e.g valuation) of this object.RandomVariable
getValue(double evaluationTime, LIBORModelMonteCarloSimulationModel 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, LIBORModelMonteCarloSimulationModel model, Schedule schedule, boolean paysFloatingRate, double fixRate, double notional)
Determines the time \( t \)-measurable value of a swap leg (can handle fix or float).String
toString()
-
Methods inherited from class net.finmath.montecarlo.interestrate.products.AbstractLIBORMonteCarloProduct
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 Detail
-
SwaptionFromSwapSchedules
public SwaptionFromSwapSchedules(LocalDateTime referenceDate, SwaptionFromSwapSchedules.SwaptionType swaptionType, LocalDate exerciseDate, Schedule scheduleFixedLeg, Schedule scheduleFloatLeg, double swaprate, double notional, Swaption.ValueUnit valueUnit)
-
-
Method Detail
-
getValue
public RandomVariable getValue(double evaluationTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException
Description 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 classAbstractLIBORMonteCarloProduct
- 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
public TimeDiscretization getProcessTimeDiscretization(LocalDateTime referenceDate)
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
public LocalDate getExerciseDate()
- Returns:
- the exercise date
-
getValueOfLegAnalytic
public static RandomVariable getValueOfLegAnalytic(double evaluationTime, LIBORModelMonteCarloSimulationModel model, Schedule schedule, boolean paysFloatingRate, double fixRate, double notional) throws CalculationException
Determines 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.getLIBOR(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
public String toString()
- Overrides:
toString
in classAbstractMonteCarloProduct
-
-