Class VolatilityCubeFactory


  • public class VolatilityCubeFactory
    extends Object
    A factory for all volatility cubes, based on common input.
    Author:
    Christian Fries, Roland Bachl
    • Constructor Detail

      • VolatilityCubeFactory

        public VolatilityCubeFactory​(LocalDate referenceDate,
                                     SwaptionDataLattice cashPayerPremiums,
                                     SwaptionDataLattice cashReceiverPremiums,
                                     SwaptionDataLattice physicalPremiumsATM,
                                     double displacement,
                                     double beta,
                                     double correlationDecay,
                                     double iborOisDecorrelation,
                                     AnnuityMapping.AnnuityMappingType annuityMappingType)
        Create the factory.
        Parameters:
        referenceDate - The reference date the cubes will have.
        cashPayerPremiums - The lattice containing market targets for cash settled payer swaptions. The lattice needs to be quoted in QuotingConvention.PRICE.
        cashReceiverPremiums - The lattice containing market targets for cash settled receiver swaptions. The lattice needs to be quoted in QuotingConvention.PRICE.
        physicalPremiumsATM - Table containing physical settled swaption atm premiums.
        displacement - The displacement a cube should use.
        beta - The SABR beta parameter SABR cube should use.
        correlationDecay - The correlation decay parameter a cube should use.
        iborOisDecorrelation - The ibor ois decorrelation a cube should use.
        annuityMappingType - The type of annuity mapping to use when building the cube.
    • Method Detail

      • buildSABRVolatilityCube

        public SABRVolatilityCube buildSABRVolatilityCube​(String name,
                                                          VolatilityCubeModel model,
                                                          int[] terminations,
                                                          DataTable initialRhos,
                                                          DataTable initialBaseVols,
                                                          DataTable initialVolvols)
                                                   throws SolverException
        Build a SABRVolatilityCube by calibration via SABRCubeCalibration.
        Parameters:
        name - The name of the cube.
        model - The model for context.
        terminations - The terminations to calibrate to in each slice.
        initialRhos - Table containing initial rhos for the calibration.
        initialBaseVols - Table containing initial base volatilities for the calibration.
        initialVolvols - Table containing initial volvols for the calibration.
        Returns:
        The calibrated cube.
        Throws:
        SolverException - Thrown when either the calibration of final or initial parameters (if not provided) fails.
      • getNumberOfThreads

        public int getNumberOfThreads()
        Returns:
        The number of threads for calibration.
      • getMaxIterations

        public int getMaxIterations()
        Returns:
        The maximum number of iterations during calibration.
      • setCalibrationParameters

        public void setCalibrationParameters​(int maxIterations,
                                             int numberOfThreads)
        Set the parameters for calibration.
        Parameters:
        maxIterations - The maximum number of iterations done during calibration.
        numberOfThreads - The number of processor threads to be used.
      • setReplicationParameters

        public void setReplicationParameters​(double lowerBound,
                                             double upperBound,
                                             int numberOfEvaluationPoints)
        Set the parameters for replication.
        Parameters:
        lowerBound - The lowest swap rate to be evaluated.
        upperBound - The highest swap rate to be evaluated.
        numberOfEvaluationPoints - The number of points to be evaluated during replication.
      • getReplicationLowerBound

        public double getReplicationLowerBound()
        Returns:
        The lowest swap rate to be evaluated during replication.
      • getReplicationUpperBound

        public double getReplicationUpperBound()
        Returns:
        The highest swap rate to be evaluated during replication.
      • getReplicationNumberOfEvaluationPoints

        public double getReplicationNumberOfEvaluationPoints()
        Returns:
        The number of points to be evaluated during replication.