#include <qle/pricingengines/commodityapoengine.hpp>
Inheritance diagram for CommodityAveragePriceOptionMonteCarloEngine:
Collaboration diagram for CommodityAveragePriceOptionMonteCarloEngine:Public Member Functions | |
| CommodityAveragePriceOptionMonteCarloEngine (const QuantLib::Handle< QuantLib::YieldTermStructure > &discountCurve, const QuantLib::Handle< QuantExt::BlackScholesModelWrapper > &model, QuantLib::Size samples, QuantLib::Real beta=0.0, const QuantLib::Size seed=42) | |
| CommodityAveragePriceOptionMonteCarloEngine (const QuantLib::Handle< QuantLib::YieldTermStructure > &discountCurve, const QuantLib::Handle< QuantLib::BlackVolTermStructure > &vol, QuantLib::Size samples, QuantLib::Real beta=0.0, const QuantLib::Size seed=42) | |
| void | calculate () const override |
Public Member Functions inherited from CommodityAveragePriceOptionBaseEngine | |
| CommodityAveragePriceOptionBaseEngine (const QuantLib::Handle< QuantLib::YieldTermStructure > &discountCurve, const QuantLib::Handle< QuantExt::BlackScholesModelWrapper > &model, QuantLib::Real beta=0.0) | |
| CommodityAveragePriceOptionBaseEngine (const QuantLib::Handle< QuantLib::YieldTermStructure > &discountCurve, const QuantLib::Handle< QuantLib::BlackVolTermStructure > &vol, QuantLib::Real beta=0.0) | |
Private Member Functions | |
| void | calculateSpot () const |
| Calculations when underlying swap references a commodity spot price. More... | |
| void | calculateFuture () const |
| Calculations when underlying swap references a commodity spot price. More... | |
| void | setupFuture (std::vector< QuantLib::Real > &outVolatilities, QuantLib::Matrix &outSqrtCorr, std::vector< QuantLib::Real > &outPrices, std::vector< QuantLib::Size > &futureIndex, QuantLib::Real strike) const |
| std::vector< QuantLib::Real > | timegrid (std::vector< QuantLib::Date > &outDates) const |
Private Attributes | |
| QuantLib::Size | samples_ |
| QuantLib::Size | seed_ |
Additional Inherited Members | |
Protected Member Functions inherited from CommodityAveragePriceOptionBaseEngine | |
| QuantLib::Real | rho (const QuantLib::Date &ed_1, const QuantLib::Date &ed_2) const |
Return the correlation between two future expiry dates ed_1 and ed_2. More... | |
| bool | isModelDependent () const |
| bool | barrierTriggered (const Real price, const bool logPrice) const |
| bool | alive (const bool barrierTriggered) const |
Protected Attributes inherited from CommodityAveragePriceOptionBaseEngine | |
| QuantLib::Handle< QuantLib::YieldTermStructure > | discountCurve_ |
| QuantLib::Handle< QuantLib::BlackVolTermStructure > | volStructure_ |
| QuantLib::Real | beta_ |
| QuantLib::Real | logBarrier_ |
Commodity APO Monte Carlo Engine Monte Carlo implementation of the APO payoff Reference: Iain Clark, Commodity Option Pricing, Wiley, section 2.7.4, equations (2.118) and (2.126)
Definition at line 124 of file commodityapoengine.hpp.
| CommodityAveragePriceOptionMonteCarloEngine | ( | const QuantLib::Handle< QuantLib::YieldTermStructure > & | discountCurve, |
| const QuantLib::Handle< QuantExt::BlackScholesModelWrapper > & | model, | ||
| QuantLib::Size | samples, | ||
| QuantLib::Real | beta = 0.0, |
||
| const QuantLib::Size | seed = 42 |
||
| ) |
Definition at line 126 of file commodityapoengine.hpp.
| CommodityAveragePriceOptionMonteCarloEngine | ( | const QuantLib::Handle< QuantLib::YieldTermStructure > & | discountCurve, |
| const QuantLib::Handle< QuantLib::BlackVolTermStructure > & | vol, | ||
| QuantLib::Size | samples, | ||
| QuantLib::Real | beta = 0.0, |
||
| const QuantLib::Size | seed = 42 |
||
| ) |
Definition at line 133 of file commodityapoengine.hpp.
|
override |
Definition at line 318 of file commodityapoengine.cpp.
Here is the call graph for this function:
|
private |
Calculations when underlying swap references a commodity spot price.
Definition at line 329 of file commodityapoengine.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 427 of file commodityapoengine.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Prepare data for APO calculation. The outVolatilities parameter will be populated with separate future contract volatilities taking into account the strike level. The number of elements of outVolatilities gives the number, N, of future contracts involved in the non-accrued portion of the APO. The matrix outSqrtCorr is populated with the square root of the correlation matrix between the future contracts. The outPrices vector will be populated with the current future price values. The futureIndex is populated with the index of the future to be used on each timestep in the simulation.
Definition at line 533 of file commodityapoengine.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Return the \(n\) timesteps from today, \(t_0\), up to \(t_n\) where \(n > 0\). Note that each \(t_i\) corresponds to a pricing date \(d_i\) that is after today. The method returns the vector of time deltas \(t_i - t_{i-1}\) for \(i=1,\ldots,n\) and populates the vector outDates with the dates \(d_0, d_1,...,d_n\). Note that the size of outDates is one larger than the size of the return vector.
Definition at line 580 of file commodityapoengine.cpp.
Here is the caller graph for this function:
|
private |
Definition at line 166 of file commodityapoengine.hpp.
|
private |
Definition at line 167 of file commodityapoengine.hpp.