Class VolatilityCubeFactory
- java.lang.Object
-
- net.finmath.singleswaprate.model.volatilities.VolatilityCubeFactory
-
public class VolatilityCubeFactory extends Object
A factory for all volatility cubes, based on common input.- Author:
- Christian Fries, Roland Bachl
-
-
Constructor Summary
Constructors Constructor Description VolatilityCubeFactory(LocalDate referenceDate, SwaptionDataLattice cashPayerPremiums, SwaptionDataLattice cashReceiverPremiums, SwaptionDataLattice physicalPremiumsATM, double displacement, double beta, double correlationDecay, double iborOisDecorrelation, AnnuityMapping.AnnuityMappingType annuityMappingType)
Create the factory.
-
Method Summary
-
-
-
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
-
buildParallelSABRCube
public SABRVolatilityCubeParallel buildParallelSABRCube(String name, double rho, double volvol, SwaptionDataLattice physicalATMSwaptions, VolatilityCubeModel model)
Build aSABRVolatilityCubeParallel
from parameters viaSABRVolatilityCubeParallelFactory
.- Parameters:
name
- The name of the cube.rho
- The SABR parameter rho.volvol
- The SABR volvol parameter.physicalATMSwaptions
- Lattice containing at-the-money values of physically settled swaptions.model
- The model for context.- Returns:
- The cube.
-
buildShiftedSmileSABRCube
public SABRVolatilityCube buildShiftedSmileSABRCube(String name, VolatilityCubeModel model) throws SolverException
Build aSABRVolatilityCube
by calibration viaSABRShiftedSmileCalibration
.- Parameters:
name
- The name of the cube.model
- The model for context.- Returns:
- The calibrated cube.
- Throws:
SolverException
- Thrown when solvers fail to find suitable parameters.
-
buildSABRVolatilityCube
public SABRVolatilityCube buildSABRVolatilityCube(String name, VolatilityCubeModel model, int[] terminations) throws SolverException
Build aSABRVolatilityCube
by calibration viaSABRCubeCalibration
.- Parameters:
name
- The name of the cube.model
- The model for context.terminations
- The terminations to calibrate to in each slice.- Returns:
- The calibrated cube.
- Throws:
SolverException
- Thrown when either the calibration of final or initial parameters (if not provided) fails.
-
buildSABRVolatilityCube
public SABRVolatilityCube buildSABRVolatilityCube(String name, VolatilityCubeModel model, int[] terminations, DataTable initialRhos, DataTable initialBaseVols, DataTable initialVolvols) throws SolverException
Build aSABRVolatilityCube
by calibration viaSABRCubeCalibration
.- 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.
-
-