29 const ext::shared_ptr<StochasticProcess1D>& process,
33 up_ = process->stdDeviation(0.0,
x0_,
dt_);
38 const ext::shared_ptr<StochasticProcess1D>& process,
42 dx_ = process->stdDeviation(0.0,
x0_,
dt_);
52 const ext::shared_ptr<StochasticProcess1D>& process,
57 std::sqrt(4.0*process->variance(0.0,
x0_,
dt_)-
63 const ext::shared_ptr<StochasticProcess1D>& process,
67 dx_ = std::sqrt(process->variance(0.0,
x0_,
dt_)+
77 Tian::Tian(
const ext::shared_ptr<StochasticProcess1D>& process,
81 Real q = std::exp(process->variance(0.0,
x0_,
dt_));
84 up_ = 0.5 *
r *
q * (
q + 1 + std::sqrt(
q *
q + 2 *
q - 3));
85 down_ = 0.5 *
r *
q * (
q + 1 - std::sqrt(
q *
q + 2 *
q - 3));
105 QL_REQUIRE(strike>0.0,
"strike must be positive");
106 Size oddSteps = ((steps % 2) != 0U ? steps : (steps + 1));
115 up_ = ermqdt * pdash /
pu_;
123 Real alpha5 = alpha3*alpha2;
124 Real alpha7 = alpha5*alpha2;
126 Real gamma = (5.0/6.0)*alpha5 + (13.0/12.0)*alpha3
128 Real delta = -0.1025 *
alpha- 0.9285 *alpha3
129 -1.43 *alpha5 -0.5 *alpha7;
131 Real rootk = std::sqrt(k);
134 p+= gamma/(k*k*rootk);
136 p+= delta/(k*k*k*rootk);
146 QL_REQUIRE(strike>0.0,
"strike must be positive");
147 Size oddSteps = (steps % 2) != 0U ? steps : (steps + 1);
155 up_ = ermqdt * pdash /
pu_;
Additive equal probabilities binomial tree.
AdditiveEQPBinomialTree(const ext::shared_ptr< StochasticProcess1D > &, Time end, Size steps, Real strike)
Binomial tree base class.
Cox-Ross-Rubinstein (multiplicative) equal jumps binomial tree.
CoxRossRubinstein(const ext::shared_ptr< StochasticProcess1D > &, Time end, Size steps, Real strike)
Base class for equal jumps binomial tree.
Base class for equal probabilities binomial tree.
Jarrow-Rudd (multiplicative) equal probabilities binomial tree.
JarrowRudd(const ext::shared_ptr< StochasticProcess1D > &, Time end, Size steps, Real strike)
Joshi4(const ext::shared_ptr< StochasticProcess1D > &, Time end, Size steps, Real strike)
Real computeUpProb(Real k, Real dj) const
Leisen & Reimer tree: multiplicative approach.
LeisenReimer(const ext::shared_ptr< StochasticProcess1D > &, Time end, Size steps, Real strike)
Tian tree: third moment matching, multiplicative approach
Tian(const ext::shared_ptr< StochasticProcess1D > &, Time end, Size steps, Real strike)
Trigeorgis (additive equal jumps) binomial tree
Trigeorgis(const ext::shared_ptr< StochasticProcess1D > &, Time end, Size steps, Real strike)
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
LinearInterpolation variance
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container
Real PeizerPrattMethod2Inversion(Real z, BigNatural n)
ext::shared_ptr< YieldTermStructure > q
ext::shared_ptr< YieldTermStructure > r