Class BermudanSwaptionFromSwapSchedules

All Implemented Interfaces:
Product, Swaption, RegressionBasisFunctionsProvider, TermStructureMonteCarloProduct, MonteCarloProduct, ProcessTimeDiscretizationProvider

Implements the valuation of a Bermudan swaption under a LIBORModelMonteCarloSimulationModel
Version:
1.4
Author:
Christian Fries
Date:
06.12.2009, 07.04.2019
  • 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. For conditionalExpectationRegressionFactory you may pass new 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 functions
      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, 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

      public LocalDate[] getExerciseDates()
      Returns the exercise dates.
      Returns:
      the exercise dates
    • getSwaptionType

      Returns:
      the swaptionType
    • getSwapEndDate

      public LocalDate getSwapEndDate()
      Returns:
      the swapEndDate
    • getValues

      public Map<String,Object> getValues(double evaluationTime, TermStructureMonteCarloSimulationModel model) throws CalculationException
      Description 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 interface TermStructureMonteCarloProduct
      Overrides:
      getValues in class AbstractTermStructureMonteCarloProduct
      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 the cause() method.
    • getValue

      public RandomVariable getValue(double evaluationTime, TermStructureMonteCarloSimulationModel 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 interface TermStructureMonteCarloProduct
      Specified by:
      getValue in class AbstractTermStructureMonteCarloProduct
      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 the cause() method.
    • getExerciseProbabilitiesFromTimes

      public double[] getExerciseProbabilitiesFromTimes(LocalDateTime localDateTime, RandomVariable exerciseTimes)
      Determines the vector of exercise probabilities for a given RandomVariable of exerciseTimes. The exerciseTimes is a random variable of FloatingpointDate offsets from a given referenceDate.
      Parameters:
      localDateTime - A given reference date.
      exerciseTimes - A RandomVariable of exercise times given as FloatingpointDate 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

      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 interface ProcessTimeDiscretizationProvider
      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 CalculationException
      The conditional expectation is calculated using a Monte-Carlo regression technique.
      Parameters:
      exerciseTime - The exercise time
      model - 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: RegressionBasisFunctionsProvider
      Provides a set of \( \mathcal{F}_{t} \)-measurable random variables which can serve as regression basis functions.
      Specified by:
      getBasisFunctions in interface RegressionBasisFunctionsProvider
      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:
      toString in class AbstractMonteCarloProduct