41 ext::shared_ptr<KlugeExtOUProcess> klugeOUProcess,
42 ext::shared_ptr<YieldTermStructure> rTS,
47 ext::shared_ptr<GasShape> gasShape,
48 ext::shared_ptr<PowerShape> powerShape,
50 : klugeOUProcess_(
std::move(klugeOUProcess)),
rTS_(
std::move(rTS)), tGrid_(tGrid),
51 xGrid_(xGrid), yGrid_(yGrid), uGrid_(uGrid), gasShape_(
std::move(gasShape)),
52 powerShape_(
std::move(powerShape)), schemeDesc_(schemeDesc) {}
57 =
rTS_->dayCounter().yearFraction(
rTS_->referenceDate(),
59 const ext::shared_ptr<ExtOUWithJumpsProcess> klugeProcess
61 const ext::shared_ptr<StochasticProcess1D> ouProcess
62 = klugeProcess->getExtendedOrnsteinUhlenbeckProcess();
63 const ext::shared_ptr<Fdm1dMesher> xMesher(
66 const ext::shared_ptr<Fdm1dMesher> yMesher(
69 klugeProcess->jumpIntensity(),
70 klugeProcess->eta()));
72 const ext::shared_ptr<Fdm1dMesher> uMesher(
77 const ext::shared_ptr<FdmMesher> mesher(
81 ext::shared_ptr<BasketPayoff> basketPayoff =
83 QL_REQUIRE(basketPayoff,
" basket payoff expected");
85 const ext::shared_ptr<Payoff> zeroStrikeCall(
88 const ext::shared_ptr<FdmInnerValueCalculator> gasPrice(
92 const ext::shared_ptr<FdmInnerValueCalculator> powerPrice(
95 const ext::shared_ptr<FdmInnerValueCalculator> calculator(
99 const ext::shared_ptr<FdmStepConditionComposite> conditions =
103 rTS_->referenceDate(),
rTS_->dayCounter());
110 calculator, maturity,
tGrid_, 0 };
112 const ext::shared_ptr<FdmKlugeExtOUSolver<3> > solver(
117 std::vector<Real> x(3);
const ext::shared_ptr< GasShape > gasShape_
void calculate() const override
const ext::shared_ptr< KlugeExtOUProcess > klugeOUProcess_
const ext::shared_ptr< PowerShape > powerShape_
FdKlugeExtOUSpreadEngine(ext::shared_ptr< KlugeExtOUProcess > klugeOUProcess, ext::shared_ptr< YieldTermStructure > rTS, Size tGrid=25, Size xGrid=50, Size yGrid=10, Size uGrid=25, ext::shared_ptr< GasShape > gasShape=ext::shared_ptr< GasShape >(), ext::shared_ptr< PowerShape > powerShape=ext::shared_ptr< PowerShape >(), const FdmSchemeDesc &schemeDesc=FdmSchemeDesc::Hundsdorfer())
const ext::shared_ptr< YieldTermStructure > rTS_
const FdmSchemeDesc schemeDesc_
static ext::shared_ptr< FdmStepConditionComposite > vanillaComposite(const DividendSchedule &schedule, const ext::shared_ptr< Exercise > &exercise, const ext::shared_ptr< FdmMesher > &mesher, const ext::shared_ptr< FdmInnerValueCalculator > &calculator, const Date &refDate, const DayCounter &dayCounter)
VanillaOption::results results_
VanillaOption::arguments arguments_
Shared handle to an observable.
ext::shared_ptr< Exercise > exercise
ext::shared_ptr< Payoff > payoff
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Option exercise classes and payoff function.
mesher for a exponential jump mesher with high mean reversion rate and low jump intensity
extended Ornstein-Uhlenbeck process
Ornstein Uhlenbeck process plus exp jumps (Kluge Model)
FD Kluge/extended Ornstein-Uhlenbeck engine for a simple power-gas spread option.
american step condition for multi dimensional problems
bermudan step condition for multi dimensional problems
const ext::shared_ptr< YieldTermStructure > rTS_
Kluge/extended Ornstein-Uhlenbeck FDM solver.
memory layout of a fdm linear operator
FdmMesher which is a composite of Fdm1dMesher.
One-dimensional grid mesher.
inner value calculator for a spread payoff
composite of fdm step conditions
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container
joint Kluge process an d Ornstein Uhlenbeck process
std::vector< ext::shared_ptr< Dividend > > DividendSchedule
OperatorTraits< FdmLinearOp >::bc_set FdmBoundaryConditionSet
Interest-rate term structure.