## Class Cap

• All Implemented Interfaces:
AnalyticProduct, Product
Direct Known Subclasses:
CapShiftedVol

public class Cap
extends AbstractAnalyticProduct
Implements the valuation of a cap via an analytic model, i.e. the specification of a forward curve, discount curve and volatility surface. A cap is a portfolio of Caplets with a common strike, i.e., the strike is the same for all Caplets. The class can value a caplet with a given strike or given moneyness. If moneyness is given, the class calculates the ATM forward. Note that this is done by omitting the first (fixed) period, see getATMForward(AnalyticModel, boolean). Note: A fixing in arrears is not handled correctly since a convexity adjustment is currently not applied.
Version:
1.0
Author:
Christian Fries
To dos:
Support convexity adjustment if fixing is in arrears.
• ### Constructor Summary

Constructors
Constructor Description
Cap​(Schedule schedule, String forwardCurveName, double strike, boolean isStrikeMoneyness, String discountCurveName, String volatilitySurfaceName)
Create a Caplet with a given schedule, strike on a given forward curve (by name) with a given discount curve and volatility surface (by name).
Cap​(Schedule schedule, String forwardCurveName, double strike, boolean isStrikeMoneyness, String discountCurveName, String volatilitySurfaceName, VolatilitySurface.QuotingConvention quotingConvention)
Create a Caplet with a given schedule, strike on a given forward curve (by name) with a given discount curve and volatility surface (by name).
• ### Method Summary

All Methods
Modifier and Type Method Description
double getATMForward​(AnalyticModel model, boolean isFirstPeriodIncluded)
Return the ATM forward for this cap.
String getDiscountCurveName()
Returns the name of the discount curve referenced by this cap.
String getForwardCurveName()
Returns the name of the forward curve references by this cap.
double getImpliedVolatility​(double evaluationTime, AnalyticModel model, VolatilitySurface.QuotingConvention quotingConvention)
Returns the value of this cap in terms of an implied volatility (of a flat caplet surface).
double getStrike()
Returns the strike of this caplet.
double getValue​(double evaluationTime, AnalyticModel model)
Return the valuation of the product using the given model.
double getValueAsPrice​(double evaluationTime, AnalyticModel model)
Returns the value of this product under the given model.
String toString()
• ### Methods inherited from class net.finmath.marketdata.products.AbstractAnalyticProduct

getValue, getValue
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
• ### Methods inherited from interface net.finmath.modelling.Product

getValues
• ### Constructor Detail

• #### Cap

public Cap​(Schedule schedule,
String forwardCurveName,
double strike,
boolean isStrikeMoneyness,
String discountCurveName,
String volatilitySurfaceName,
VolatilitySurface.QuotingConvention quotingConvention)
Create a Caplet with a given schedule, strike on a given forward curve (by name) with a given discount curve and volatility surface (by name). The valuation is performed using analytic valuation formulas for the underlying caplets.
Parameters:
schedule - A given payment schedule, i.e., a collection of Periods with fixings, payments and period length.
forwardCurveName - The forward curve to be used for the forward of the index.
strike - The given strike (or moneyness).
isStrikeMoneyness - If true, then the strike argument is interpreted as moneyness, i.e. we calculate an ATM forward from the schedule.
discountCurveName - The discount curve to be used for discounting.
volatilitySurfaceName - The volatility surface to be used.
quotingConvention - The quoting convention of the value returned by the getValue(double, net.finmath.marketdata.model.AnalyticModel)-method.
• #### Cap

public Cap​(Schedule schedule,
String forwardCurveName,
double strike,
boolean isStrikeMoneyness,
String discountCurveName,
String volatilitySurfaceName)
Create a Caplet with a given schedule, strike on a given forward curve (by name) with a given discount curve and volatility surface (by name). The valuation is performed using analytic valuation formulas for the underlying caplets.
Parameters:
schedule - A given payment schedule, i.e., a collection of Periods with fixings, payments and period length.
forwardCurveName - The forward curve to be used for the forward of the index.
strike - The given strike (or moneyness).
isStrikeMoneyness - If true, then the strike argument is interpreted as moneyness, i.e. we calculate an ATM forward from the schedule.
discountCurveName - The discount curve to be used for discounting.
volatilitySurfaceName - The volatility surface to be used.
• ### Method Detail

• #### getValue

public double getValue​(double evaluationTime,
AnalyticModel model)
Description copied from interface: AnalyticProduct
Return the valuation of the product using the given model. The model has to implement the modes of AnalyticModel.
Parameters:
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.
Returns:
The value of the product using the given model.
• #### getValueAsPrice

public double getValueAsPrice​(double evaluationTime,
AnalyticModel model)
Returns the value of this product under the given model.
Parameters:
evaluationTime - Evaluation time.
model - The model.
Returns:
Value of this product und the given model.
• #### getATMForward

public double getATMForward​(AnalyticModel model,
boolean isFirstPeriodIncluded)
Return the ATM forward for this cap. The ATM forward is the fixed rate K such that the value of the payoffs $$F(t_i) - K$$ is zero, where $$F(t_i)$$ is the ATM forward of the i-th caplet. Note however that the is a convention to determine the ATM forward of a cap from the payoffs excluding the first one. The reason here is that for non-forward starting cap, the first period is already fixed, i.e. it has no vega.
Parameters:
model - The model to retrieve the forward curve from (by name).
isFirstPeriodIncluded - If true, the forward will be determined by considering the periods after removal of the first periods (except, if the Cap consists only of 1 period).
Returns:
The ATM forward of this cap.
• #### getImpliedVolatility

public double getImpliedVolatility​(double evaluationTime,
AnalyticModel model,
VolatilitySurface.QuotingConvention quotingConvention)
Returns the value of this cap in terms of an implied volatility (of a flat caplet surface).
Parameters:
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.
quotingConvention - The quoting convention requested for the return value.
Returns:
The value of the product using the given model in terms of a implied volatility.
• #### getForwardCurveName

public String getForwardCurveName()
Returns the name of the forward curve references by this cap.
Returns:
the forward curve name.
• #### getStrike

public double getStrike()
Returns the strike of this caplet.
Returns:
the strike
• #### getDiscountCurveName

public String getDiscountCurveName()
Returns the name of the discount curve referenced by this cap.
Returns:
the discount curve name
• #### toString

public String toString()
Overrides:
toString in class Object