Module net.finmath.lib
Class BermudanSwaptionFromSwapSchedules
java.lang.Object
net.finmath.montecarlo.AbstractMonteCarloProduct
net.finmath.montecarlo.interestrate.products.AbstractTermStructureMonteCarloProduct
net.finmath.montecarlo.interestrate.products.BermudanSwaptionFromSwapSchedules
- All Implemented Interfaces:
Product
,Swaption
,RegressionBasisFunctionsProvider
,TermStructureMonteCarloProduct
,MonteCarloProduct
,ProcessTimeDiscretizationProvider
public class BermudanSwaptionFromSwapSchedules
extends AbstractTermStructureMonteCarloProduct
implements RegressionBasisFunctionsProvider, ProcessTimeDiscretizationProvider, Swaption
Implements the valuation of a Bermudan swaption under a
LIBORModelMonteCarloSimulationModel
- Version:
- 1.4
- Author:
- Christian Fries
- Date:
- 06.12.2009, 07.04.2019
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.finmath.modelling.products.Swaption
Swaption.ValueUnit
-
Constructor Summary
ConstructorsConstructorDescriptionBermudanSwaptionFromSwapSchedules(LocalDateTime referenceDate, BermudanSwaptionFromSwapSchedules.SwaptionType swaptionType, LocalDate[] exerciseDates, LocalDate swapEndDate, double[] swaprates, double[] notionals, Schedule[] fixSchedules, Schedule[] floatSchedules)
Create a Bermudan swaption.BermudanSwaptionFromSwapSchedules(LocalDateTime referenceDate, BermudanSwaptionFromSwapSchedules.SwaptionType swaptionType, LocalDate[] exerciseDates, LocalDate swapEndDate, double[] swaprates, double[] notionals, Schedule[] fixSchedules, Schedule[] floatSchedules, MonteCarloConditionalExpectationRegressionFactory conditionalExpectationRegressionFactory, RegressionBasisFunctionsProvider regressionBasisFunctionProvider)
Create a Bermudan swaption from an array of underlying swap schedules (fix leg and float leg), swap rates and notionals.BermudanSwaptionFromSwapSchedules(LocalDateTime referenceDate, BermudanSwaptionFromSwapSchedules.SwaptionType swaptionType, LocalDate[] exerciseDates, LocalDate swapEndDate, double[] swaprates, double[] notionals, Schedule[] fixSchedules, Schedule[] floatSchedules, RegressionBasisFunctionsProvider regressionBasisFunctionProvider)
Create a Bermudan swaption.BermudanSwaptionFromSwapSchedules(LocalDateTime referenceDate, BermudanSwaptionFromSwapSchedules.SwaptionType swaptionType, LocalDate[] exerciseDates, LocalDate swapEndDate, double swaprate, double notional, Schedule[] fixSchedules, Schedule[] floatSchedules)
Create a Bermudan swaption. -
Method Summary
Modifier and TypeMethodDescriptiongetBasisFunctions(double evaluationTime, LIBORModelMonteCarloSimulationModel model)
Provides a set of \( \mathcal{F}_{t} \)-measurable random variables which can serve as regression basis functions.getBasisFunctions(double evaluationTime, MonteCarloSimulationModel model)
Provides a set of \( \mathcal{F}_{t} \)-measurable random variables which can serve as regression basis functions.getConditionalExpectationEstimator(double exerciseTime, TermStructureMonteCarloSimulationModel model)
The conditional expectation is calculated using a Monte-Carlo regression technique.Returns the exercise dates.double[]
getExerciseProbabilitiesFromTimes(LocalDateTime localDateTime, RandomVariable exerciseTimes)
Determines the vector of exercise probabilities for a givenRandomVariable
of exerciseTimes.getProcessTimeDiscretization(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.getValues(double evaluationTime, TermStructureMonteCarloSimulationModel model)
This method returns the valuation of the product within the specified model, evaluated at a given evalutationTime.toString()
Methods inherited from class net.finmath.montecarlo.interestrate.products.AbstractTermStructureMonteCarloProduct
getFactorDrift, getValue, getValueForModifiedData
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
-
BermudanSwaptionFromSwapSchedules
public BermudanSwaptionFromSwapSchedules(LocalDateTime referenceDate, BermudanSwaptionFromSwapSchedules.SwaptionType swaptionType, LocalDate[] exerciseDates, LocalDate swapEndDate, double[] swaprates, double[] notionals, Schedule[] fixSchedules, Schedule[] floatSchedules, MonteCarloConditionalExpectationRegressionFactory conditionalExpectationRegressionFactory, RegressionBasisFunctionsProvider regressionBasisFunctionProvider)Create a Bermudan swaption from an array of underlying swap schedules (fix leg and float leg), swap rates and notionals. This class implements the class backward algorithm using a provided factory for the determination of the conditional expectation. ForconditionalExpectationRegressionFactory
you may passnew MonteCarloConditionalExpectationLinearRegressionFactory()
(default) or, e.g.,new MonteCarloConditionalExpectationLocalizedOnDependentRegressionFactory(2.0)
.- Parameters:
referenceDate
- The date associated with the inception (t=0) of this product. (Not used).swaptionType
- The type of the underlying swap (PAYER, RECEIVER).exerciseDates
- A vector of exercise dates.swapEndDate
- The final maturity of the underlying swap.swaprates
- A vector of swap rates for the underlying swaps.notionals
- A vector of notionals for the underlying swaps.fixSchedules
- A vector of fix leg schedules for the underlying swaps.floatSchedules
- A vector of float leg schedules for the underlying swaps.conditionalExpectationRegressionFactory
- A object implementing a factory creating a conditional expectation estimator from given regression basis functionsregressionBasisFunctionProvider
- An object implementing RegressionBasisFunctionsProvider to provide the basis functions for the estimation of conditional expectations.
-
BermudanSwaptionFromSwapSchedules
public BermudanSwaptionFromSwapSchedules(LocalDateTime referenceDate, BermudanSwaptionFromSwapSchedules.SwaptionType swaptionType, LocalDate[] exerciseDates, LocalDate swapEndDate, double[] swaprates, double[] notionals, Schedule[] fixSchedules, Schedule[] floatSchedules, RegressionBasisFunctionsProvider regressionBasisFunctionProvider)Create a Bermudan swaption.- Parameters:
referenceDate
- The date associated with the inception (t=0) of this product. (Not used).swaptionType
- The type of the underlying swap (PAYER, RECEIVER).exerciseDates
- A vector of exercise dates.swapEndDate
- The final maturity of the underlying swap.swaprates
- A vector of swap rates for the underlying swaps.notionals
- A vector of notionals for the underlying swaps.fixSchedules
- A vector of fix leg schedules for the underlying swaps.floatSchedules
- A vector of float leg schedules for the underlying swaps.regressionBasisFunctionProvider
- An object implementing RegressionBasisFunctionsProvider to provide the basis functions for the estimation of conditional expectations.
-
BermudanSwaptionFromSwapSchedules
public BermudanSwaptionFromSwapSchedules(LocalDateTime referenceDate, BermudanSwaptionFromSwapSchedules.SwaptionType swaptionType, LocalDate[] exerciseDates, LocalDate swapEndDate, double[] swaprates, double[] notionals, Schedule[] fixSchedules, Schedule[] floatSchedules)Create a Bermudan swaption.- Parameters:
referenceDate
- The date associated with the inception (t=0) of this product. (Not used).swaptionType
- The type of the underlying swap (PAYER, RECEIVER).exerciseDates
- A vector of exercise dates.swapEndDate
- The final maturity of the underlying swap.swaprates
- A vector of swap rates for the underlying swaps.notionals
- A vector of notionals for the underlying swaps.fixSchedules
- A vector of fix leg schedules for the underlying swaps.floatSchedules
- A vector of float leg schedules for the underlying swaps.
-
BermudanSwaptionFromSwapSchedules
public BermudanSwaptionFromSwapSchedules(LocalDateTime referenceDate, BermudanSwaptionFromSwapSchedules.SwaptionType swaptionType, LocalDate[] exerciseDates, LocalDate swapEndDate, double swaprate, double notional, Schedule[] fixSchedules, Schedule[] floatSchedules)Create a Bermudan swaption.- Parameters:
referenceDate
- The date associated with the inception (t=0) of this product.swaptionType
- The type of the underlying swap (PAYER, RECEIVER).exerciseDates
- A vector of exercise dates.swapEndDate
- The final maturity of the underlying swap.swaprate
- A constant swaprate applying to all underlying swaps.notional
- A constant notional applying to all underlying swaps.fixSchedules
- A vector of fix leg schedules for the underlying swaps.floatSchedules
- A vector of float leg schedules for the underlying swaps.
-
-
Method Details
-
getExerciseDates
Returns the exercise dates.- Returns:
- the exercise dates
-
getSwaptionType
- Returns:
- the swaptionType
-
getSwapEndDate
- Returns:
- the swapEndDate
-
getValues
public Map<String,Object> getValues(double evaluationTime, TermStructureMonteCarloSimulationModel model) throws CalculationExceptionDescription copied from interface:TermStructureMonteCarloProduct
This method returns the valuation of the product within the specified model, evaluated at a given evalutationTime. The valuation is returned in terms of a map. The map may contain additional information. 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:
getValues
in interfaceTermStructureMonteCarloProduct
- Overrides:
getValues
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.
-
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.
-
getExerciseProbabilitiesFromTimes
public double[] getExerciseProbabilitiesFromTimes(LocalDateTime localDateTime, RandomVariable exerciseTimes)Determines the vector of exercise probabilities for a givenRandomVariable
of exerciseTimes. The exerciseTimes is a random variable ofFloatingpointDate
offsets from a given referenceDate.- Parameters:
localDateTime
- A given reference date.exerciseTimes
- ARandomVariable
of exercise times given asFloatingpointDate
offsets from the given referenceDate.- Returns:
- A vector of exercise probabilities. The length of the vector is
exerciseDates.length+1
. The last entry is the probability that no exercise occurs.
-
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.
-
getConditionalExpectationEstimator
public ConditionalExpectationEstimator getConditionalExpectationEstimator(double exerciseTime, TermStructureMonteCarloSimulationModel model) throws CalculationExceptionThe conditional expectation is calculated using a Monte-Carlo regression technique.- Parameters:
exerciseTime
- The exercise timemodel
- The valuation model- Returns:
- The condition expectation estimator
- Throws:
CalculationException
- Thrown if underlying model failed to calculate stochastic process.
-
getBasisFunctions
public RandomVariable[] getBasisFunctions(double evaluationTime, MonteCarloSimulationModel model) throws CalculationExceptionDescription copied from interface:RegressionBasisFunctionsProvider
Provides a set of \( \mathcal{F}_{t} \)-measurable random variables which can serve as regression basis functions.- Specified by:
getBasisFunctions
in interfaceRegressionBasisFunctionsProvider
- Parameters:
evaluationTime
- The evaluation time \( t \) at which the basis function should be observed.model
- The Monte-Carlo model used to derive the basis function.- Returns:
- An \( \mathcal{F}_{t} \)-measurable random variable.
- Throws:
CalculationException
- Thrown if derivation of the basis function fails.
-
getBasisFunctions
public RandomVariable[] getBasisFunctions(double evaluationTime, LIBORModelMonteCarloSimulationModel model) throws CalculationExceptionProvides a set of \( \mathcal{F}_{t} \)-measurable random variables which can serve as regression basis functions.- Parameters:
evaluationTime
- The evaluation time \( t \) at which the basis function should be observed.model
- The Monte-Carlo model used to derive the basis function.- Returns:
- An \( \mathcal{F}_{t} \)-measurable random variable.
- Throws:
CalculationException
- Thrown if derivation of the basis function fails.
-
getBasisFunctionsProviderWithSwapRates
-
getBasisFunctionsProviderWithForwardRates
-
toString
- Overrides:
toString
in classAbstractMonteCarloProduct
-