45 ext::shared_ptr<ExtOUWithJumpsProcess> process,
46 ext::shared_ptr<YieldTermStructure> rTS,
50 ext::shared_ptr<Shape> shape,
52 : process_(
std::move(process)),
rTS_(
std::move(rTS)), shape_(
std::move(shape)), tGrid_(tGrid),
53 xGrid_(xGrid), yGrid_(yGrid), schemeDesc_(schemeDesc) {}
58 ext::shared_ptr<SwingExercise> swingExercise(
61 QL_REQUIRE(swingExercise,
"Swing exercise supported only");
64 const std::vector<Time> exerciseTimes
65 = swingExercise->exerciseTimes(
rTS_->dayCounter(),
66 rTS_->referenceDate());
68 const Time maturity = exerciseTimes.back();
69 const ext::shared_ptr<StochasticProcess1D> ouProcess(
70 process_->getExtendedOrnsteinUhlenbeckProcess());
71 const ext::shared_ptr<Fdm1dMesher> xMesher(
74 const ext::shared_ptr<Fdm1dMesher> yMesher(
79 const ext::shared_ptr<Fdm1dMesher> exerciseMesher(
84 const ext::shared_ptr<FdmMesher> mesher(
88 ext::shared_ptr<FdmInnerValueCalculator> calculator(
91 std::list<ext::shared_ptr<StepCondition<Array> > > stepConditions;
92 std::list<std::vector<Time> > stoppingTimes;
95 stoppingTimes.push_back(exerciseTimes);
97 ext::shared_ptr<FdmInnerValueCalculator> exerciseCalculator(
102 exerciseTimes, mesher, exerciseCalculator,
105 ext::shared_ptr<FdmStepConditionComposite> conditions(
114 calculator, maturity,
tGrid_, 0 };
116 const ext::shared_ptr<FdmSimple3dExtOUJumpSolver> solver(
FdSimpleExtOUJumpSwingEngine(ext::shared_ptr< ExtOUWithJumpsProcess > p, ext::shared_ptr< YieldTermStructure > rTS, Size tGrid=50, Size xGrid=200, Size yGrid=50, ext::shared_ptr< Shape > shape=ext::shared_ptr< Shape >(), const FdmSchemeDesc &schemeDesc=FdmSchemeDesc::Hundsdorfer())
void calculate() const override
const ext::shared_ptr< ExtOUWithJumpsProcess > process_
const ext::shared_ptr< Shape > shape_
const ext::shared_ptr< YieldTermStructure > rTS_
const FdmSchemeDesc schemeDesc_
VanillaSwingOption::results results_
VanillaSwingOption::arguments arguments_
Shared handle to an observable.
condition to be applied at every time step
ext::shared_ptr< SwingExercise > exercise
ext::shared_ptr< StrikedTypePayoff > payoff
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
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)
1-d mesher for the Black-Scholes process (in ln(S))
const ext::shared_ptr< YieldTermStructure > rTS_
inner value calculator for the Ornstein Uhlenbeck plus exponential jumps model (Kluge Model)
memory layout of a fdm linear operator
FdmMesher which is a composite of Fdm1dMesher.
solver for simple swing options based on ext OU-Jump (Kluge) Model
One-dimensional grid mesher.
simple swing step condition
composite of fdm step conditions
Finite Differences engine for simple swing options.
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container
OperatorTraits< FdmLinearOp >::bc_set FdmBoundaryConditionSet
Interest-rate term structure.