Commodity Swaption Monte Carlo Engine. More...
#include <qle/pricingengines/commodityswaptionengine.hpp>
Inheritance diagram for CommoditySwaptionMonteCarloEngine:
Collaboration diagram for CommoditySwaptionMonteCarloEngine:Public Member Functions | |
| CommoditySwaptionMonteCarloEngine (const Handle< YieldTermStructure > &discountCurve, const Handle< QuantLib::BlackVolTermStructure > &vol, Size samples, Real beta=0.0, const Size seed=42) | |
| void | calculate () const override |
Public Member Functions inherited from CommoditySwaptionBaseEngine | |
| CommoditySwaptionBaseEngine (const Handle< YieldTermStructure > &discountCurve, const Handle< QuantLib::BlackVolTermStructure > &vol, Real beta=0.0) | |
Private Member Functions | |
| void | calculateSpot (QuantLib::Size idxFixed, QuantLib::Size idxFloat, QuantLib::Real strike) const |
| Calculations when underlying swap references a commodity spot price. More... | |
| void | calculateFuture (QuantLib::Size idxFixed, QuantLib::Size idxFloat, QuantLib::Real strike) const |
| Calculations when underlying swap references a commodity spot price. More... | |
| QuantLib::Real | spotFloatLegFactor (QuantLib::Size idxFloat, QuantLib::Real discountExercise) const |
| void | futureFloatLegFactors (QuantLib::Size idxFloat, QuantLib::Real discountExercise, const std::vector< QuantLib::Date > &expiries, QuantLib::Matrix &floatLegFactors, QuantLib::Array &discounts, QuantLib::Array &amounts) const |
| std::map< QuantLib::Date, QuantLib::Real > | futureExpiries (QuantLib::Size idxFloat, QuantLib::Matrix &outSqrtCorr, QuantLib::Real strike) const |
Private Attributes | |
| Size | samples_ |
| long | seed_ |
Additional Inherited Members | |
Protected Member Functions inherited from CommoditySwaptionBaseEngine | |
| QuantLib::Size | fixedLegIndex () const |
| QuantLib::Real | fixedLegValue (QuantLib::Size fixedLegIndex) const |
| Give back the fixed leg price at the swaption expiry time. More... | |
| QuantLib::Real | strike (QuantLib::Size fixedLegIndex) const |
| QuantLib::Real | rho (const QuantLib::Date &ed_1, const QuantLib::Date &ed_2) const |
| bool | averaging (QuantLib::Size floatLegIndex) const |
Protected Attributes inherited from CommoditySwaptionBaseEngine | |
| Handle< YieldTermStructure > | discountCurve_ |
| Handle< QuantLib::BlackVolTermStructure > | volStructure_ |
| Real | beta_ |
Commodity Swaption Monte Carlo Engine.
Monte Carlo implementation of the Swaption payoff for as documented in ORE+ Product Catalogue. Reference: Iain Clark, Commodity Option Pricing, Wiley, section 2.8
Definition at line 116 of file commodityswaptionengine.hpp.
| CommoditySwaptionMonteCarloEngine | ( | const Handle< YieldTermStructure > & | discountCurve, |
| const Handle< QuantLib::BlackVolTermStructure > & | vol, | ||
| Size | samples, | ||
| Real | beta = 0.0, |
||
| const Size | seed = 42 |
||
| ) |
Definition at line 118 of file commodityswaptionengine.hpp.
|
override |
Definition at line 424 of file commodityswaptionengine.cpp.
Here is the call graph for this function:
|
private |
Calculations when underlying swap references a commodity spot price.
Definition at line 441 of file commodityswaptionengine.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Calculations when underlying swap references a commodity spot price.
Definition at line 498 of file commodityswaptionengine.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Calculate the underlying spot float leg factor value at expiry time. This quantity will be multiplied by a sample value on each Monte Carlo iteration to give the swap float leg value.
Definition at line 584 of file commodityswaptionengine.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Populate the factors that we need to value the floating leg of a swap referencing a future contract given a Monte Carlo sample. This is to avoid recalculation of these quantities on each iteration.
Definition at line 611 of file commodityswaptionengine.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Given the index of the floating leg idxFloat, populate a map where the keys are the unique expiry dates of the future contracts referenced in the floating leg and the values are the volatilities associated with the future contract. Also, the matrix outSqrtCorr is poulated with the square root of the correlation matrix between the expiries.
An exception is thrown if the floating leg is not referencing a commodity future price.
Definition at line 663 of file commodityswaptionengine.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 153 of file commodityswaptionengine.hpp.
|
private |
Definition at line 154 of file commodityswaptionengine.hpp.