Module net.finmath.lib
Class VolatilityCubeFactory
java.lang.Object
net.finmath.singleswaprate.model.volatilities.VolatilityCubeFactory
A factory for all volatility cubes, based on common input.
- Author:
- Christian Fries, Roland Bachl
-
Constructor Summary
ConstructorsConstructorDescriptionVolatilityCubeFactory(LocalDate referenceDate, SwaptionDataLattice cashPayerPremiums, SwaptionDataLattice cashReceiverPremiums, SwaptionDataLattice physicalPremiumsATM, double displacement, double beta, double correlationDecay, double iborOisDecorrelation, AnnuityMapping.AnnuityMappingType annuityMappingType)
Create the factory. -
Method Summary
Modifier and TypeMethodDescriptionbuildParallelSABRCube(String name, double rho, double volvol, SwaptionDataLattice physicalATMSwaptions, VolatilityCubeModel model)
Build aSABRVolatilityCubeParallel
from parameters viaSABRVolatilityCubeParallelFactory
.buildSABRVolatilityCube(String name, VolatilityCubeModel model, int[] terminations)
Build aSABRVolatilityCube
by calibration viaSABRCubeCalibration
.buildSABRVolatilityCube(String name, VolatilityCubeModel model, int[] terminations, DataTable initialRhos, DataTable initialBaseVols, DataTable initialVolvols)
Build aSABRVolatilityCube
by calibration viaSABRCubeCalibration
.buildShiftedSmileSABRCube(String name, VolatilityCubeModel model)
Build aSABRVolatilityCube
by calibration viaSABRShiftedSmileCalibration
.int
int
double
double
double
void
setCalibrationParameters(int maxIterations, int numberOfThreads)
Set the parameters for calibration.void
setReplicationParameters(double lowerBound, double upperBound, int numberOfEvaluationPoints)
Set the parameters for replication.
-
Constructor Details
-
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 Details
-
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 SolverExceptionBuild 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 SolverExceptionBuild 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 SolverExceptionBuild 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.
-