Module net.finmath.lib
Class BermudanSwaptionFromSwapSchedules
- java.lang.Object
-
- net.finmath.montecarlo.AbstractMonteCarloProduct
-
- net.finmath.montecarlo.interestrate.products.AbstractLIBORMonteCarloProduct
-
- net.finmath.montecarlo.interestrate.products.BermudanSwaptionFromSwapSchedules
-
- All Implemented Interfaces:
Product,Swaption,RegressionBasisFunctionsProvider,TermStructureMonteCarloProduct,MonteCarloProduct,ProcessTimeDiscretizationProvider
public class BermudanSwaptionFromSwapSchedules extends AbstractLIBORMonteCarloProduct implements RegressionBasisFunctionsProvider, ProcessTimeDiscretizationProvider, Swaption
Implements the valuation of a Bermudan swaption under aLIBORModelMonteCarloSimulationModel- Version:
- 1.4
- Author:
- Christian Fries
- Date:
- 06.12.2009, 07.04.2019
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBermudanSwaptionFromSwapSchedules.SwaptionType-
Nested classes/interfaces inherited from interface net.finmath.modelling.products.Swaption
Swaption.ValueUnit
-
-
Constructor Summary
Constructors Constructor Description BermudanSwaptionFromSwapSchedules(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RandomVariable[]getBasisFunctions(double evaluationTime, LIBORModelMonteCarloSimulationModel model)Provides a set of \( \mathcal{F}_{t} \)-measurable random variables which can serve as regression basis functions.RandomVariable[]getBasisFunctions(double evaluationTime, MonteCarloSimulationModel model)Provides a set of \( \mathcal{F}_{t} \)-measurable random variables which can serve as regression basis functions.RegressionBasisFunctionsProvidergetBasisFunctionsProviderWithForwardRates()RegressionBasisFunctionsProvidergetBasisFunctionsProviderWithSwapRates()ConditionalExpectationEstimatorgetConditionalExpectationEstimator(double exerciseTime, LIBORModelMonteCarloSimulationModel model)The conditional expectation is calculated using a Monte-Carlo regression technique.LocalDate[]getExerciseDates()Returns the exercise dates.double[]getExerciseProbabilitiesFromTimes(LocalDateTime localDateTime, RandomVariable exerciseTimes)Determines the vector of exercise probabilities for a givenRandomVariableof exerciseTimes.TimeDiscretizationgetProcessTimeDiscretization(LocalDateTime referenceDate)Returns a suggestion for a time discretization which is suited (or required) for the processing (e.g valuation) of this object.LocalDategetSwapEndDate()BermudanSwaptionFromSwapSchedules.SwaptionTypegetSwaptionType()RandomVariablegetValue(double evaluationTime, LIBORModelMonteCarloSimulationModel model)This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.Map<String,Object>getValues(double evaluationTime, LIBORModelMonteCarloSimulationModel model)This method returns the valuation of the product within the specified model, evaluated at a given evalutationTime.StringtoString()-
Methods inherited from class net.finmath.montecarlo.interestrate.products.AbstractLIBORMonteCarloProduct
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 Detail
-
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. ForconditionalExpectationRegressionFactoryyou 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 Detail
-
getExerciseDates
public LocalDate[] getExerciseDates()
Returns the exercise dates.- Returns:
- the exercise dates
-
getSwaptionType
public BermudanSwaptionFromSwapSchedules.SwaptionType getSwaptionType()
- Returns:
- the swaptionType
-
getSwapEndDate
public LocalDate getSwapEndDate()
- Returns:
- the swapEndDate
-
getValues
public Map<String,Object> getValues(double evaluationTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException
Description copied from interface:TermStructureMonteCarloProductThis 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:
getValuesin interfaceTermStructureMonteCarloProduct- Overrides:
getValuesin 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.
-
getValue
public RandomVariable getValue(double evaluationTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException
Description copied from interface:TermStructureMonteCarloProductThis 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 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.
-
getExerciseProbabilitiesFromTimes
public double[] getExerciseProbabilitiesFromTimes(LocalDateTime localDateTime, RandomVariable exerciseTimes)
Determines the vector of exercise probabilities for a givenRandomVariableof exerciseTimes. The exerciseTimes is a random variable ofFloatingpointDateoffsets from a given referenceDate.- Parameters:
localDateTime- A given reference date.exerciseTimes- ARandomVariableof exercise times given asFloatingpointDateoffsets 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
public TimeDiscretization getProcessTimeDiscretization(LocalDateTime referenceDate)
Description copied from interface:ProcessTimeDiscretizationProviderReturns a suggestion for a time discretization which is suited (or required) for the processing (e.g valuation) of this object.- Specified by:
getProcessTimeDiscretizationin interfaceProcessTimeDiscretizationProvider- Parameters:
referenceDate- A reference date relative to which the discretization is generated.- Returns:
- A time discretization.
-
getConditionalExpectationEstimator
public ConditionalExpectationEstimator getConditionalExpectationEstimator(double exerciseTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException
The 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 CalculationException
Description copied from interface:RegressionBasisFunctionsProviderProvides a set of \( \mathcal{F}_{t} \)-measurable random variables which can serve as regression basis functions.- Specified by:
getBasisFunctionsin 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 CalculationException
Provides 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
public RegressionBasisFunctionsProvider getBasisFunctionsProviderWithSwapRates()
-
getBasisFunctionsProviderWithForwardRates
public RegressionBasisFunctionsProvider getBasisFunctionsProviderWithForwardRates()
-
toString
public String toString()
- Overrides:
toStringin classAbstractMonteCarloProduct
-
-