public abstract class AbstractSingleSwapRateProduct extends AbstractAnalyticVolatilityCubeProduct
| Constructor and Description |
|---|
AbstractSingleSwapRateProduct(Schedule fixSchedule,
Schedule floatSchedule,
String discountCurveName,
String forwardCurveName,
String volatilityCubeName)
Create the single swap rate product.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract AnnuityMapping |
buildAnnuityMapping(VolatilityCubeModel model)
Since most annuity mappings require data from models to be created, but models are only provided at execution of
getValue,
the product needs to dynamically be able to build its annuity mapping. |
String |
getDiscountCurveName() |
Schedule |
getFixSchedule() |
Schedule |
getFloatSchedule() |
String |
getForwardCurveName() |
double |
getIntegrationLowerBound() |
int |
getIntegrationNumberOfEvaluationPoints() |
double |
getIntegrationUpperBound() |
double |
getValue(double evaluationTime,
AnnuityMapping annuityMapping,
VolatilityCubeModel model)
Return the valuation of the product using the given model.
|
double |
getValue(double evaluationTime,
VolatilityCubeModel model)
Return the valuation of the product using the given model.
|
String |
getVolatilityCubeName() |
protected abstract double |
hedgeWeight(double swapRate,
AnnuityMapping annuityMapping,
VolatilityCubeModel model)
Essentially the second derivative of the payoff function.
|
protected abstract double |
payoffFunction(double swapRate,
AnnuityMapping annuityMapping,
VolatilityCubeModel model)
Payoff function of the product.
|
void |
setIntegrationParameters(double lowerBound,
double upperBound,
int numberOfEvaluationPoints)
Set the parameters for replication.
|
protected abstract double |
singularAddon(double swapRate,
AnnuityMapping annuityMapping,
VolatilityCubeModel model)
As some products have a portion of their weight in a singular point,
this is portion is split off from the
hedgeweight and added after the integration. |
protected double |
valueCall(double optionStrike,
VolatilityCubeModel model,
double swapRate)
Value of a call option on the swap rate.
|
protected double |
valuePut(double optionStrike,
VolatilityCubeModel model,
double swapRate)
Value of a put option on the swap rate.
|
getValue, getValue, getValuepublic AbstractSingleSwapRateProduct(Schedule fixSchedule, Schedule floatSchedule, String discountCurveName, String forwardCurveName, String volatilityCubeName)
fixSchedule - The fix schedule of the swap.floatSchedule - The float schedule of the swap.discountCurveName - The name of the discount curve.forwardCurveName - The name of the forward curve.volatilityCubeName - The name of the volatility cube.public void setIntegrationParameters(double lowerBound,
double upperBound,
int numberOfEvaluationPoints)
lowerBound - The lowest strike the replication may use.upperBound - The largest strike the replication may use.numberOfEvaluationPoints - The number of points the replication may evaluate.public double getIntegrationLowerBound()
public double getIntegrationUpperBound()
public int getIntegrationNumberOfEvaluationPoints()
public double getValue(double evaluationTime,
VolatilityCubeModel model)
AnalyticVolatilityCubeProductVolatilityCubeModel.evaluationTime - The evaluation time as double. Cash flows prior and including this time are not considered.model - The model under which the product is valued.public double getValue(double evaluationTime,
AnnuityMapping annuityMapping,
VolatilityCubeModel model)
VolatilityCubeModel.
This method allows to specify an annuity mapping to be used during the evaluation.
This may be done to safe time, when many evaluations at different time, or of products with the same underlying swap rate, have to be done at once.
Otherwise each call of getValue will first instantiate an individual annuity mapping. Which may take long for more elaborate implementations.evaluationTime - The evaluation time as double. Cash flows prior and including this time are not considered.annuityMapping - The annuity mapping to be used during valuation. If left null a new mapping will be generated.model - The model under which the product is valued.protected abstract double payoffFunction(double swapRate,
AnnuityMapping annuityMapping,
VolatilityCubeModel model)
swapRate - The swap rate.annuityMapping - The annuity mapping to use.model - The model for context.protected abstract double hedgeWeight(double swapRate,
AnnuityMapping annuityMapping,
VolatilityCubeModel model)
swapRate - The swap rate.annuityMapping - The annuity mapping to use.model - The model for context.protected abstract double singularAddon(double swapRate,
AnnuityMapping annuityMapping,
VolatilityCubeModel model)
hedgeweight and added after the integration.swapRate - The swap rate.annuityMapping - The annuity mapping to use.model - The model for context.protected abstract AnnuityMapping buildAnnuityMapping(VolatilityCubeModel model)
getValue,
the product needs to dynamically be able to build its annuity mapping.
This method may be left to return null, if the product requires no annuity mapping or is intended to always receive an annuity mapping for evaluation.model - The model for context.protected double valuePut(double optionStrike,
VolatilityCubeModel model,
double swapRate)
optionStrike - The strike of the option.model - The model for context.swapRate - The swap rate.protected double valueCall(double optionStrike,
VolatilityCubeModel model,
double swapRate)
optionStrike - The strike of the option.model - The model for context.swapRate - The swap rate.public Schedule getFixSchedule()
public Schedule getFloatSchedule()
public String getDiscountCurveName()
public String getForwardCurveName()
public String getVolatilityCubeName()
Copyright © 2019. All rights reserved.