40 ext::shared_ptr<OrnsteinUhlenbeckProcess> ouProcess,
41 const std::vector<Date>& maturityDates,
49 bsProcess_(bsProcess), ouProcess_(
std::move(ouProcess)), maturityDates_(maturityDates),
51 maturityTimes_(maturityDates.size()) {
59 "dates must be sorted");
75 const Real expectation
77 const Real stdDeviation
80 return expectation + stdDeviation*
x_;
87 for (
Size i=0,
n=
s.size(); i <
n; ++i) {
102 : y_(model.
x_.size()),
104 ouProcess_(model.ouProcess_),
107 for (
Size i=0; i <
data_->s_.columns(); ++i) {
109 std::copy(
y.begin(),
y.end(),
data_->s_.column_begin(i));
112 for (
Size i=0; i <
data_->s_.rows(); ++i) {
114 data_->s_.row_begin(i));
120 for (
Size i=0; i < y_.size(); ++i) {
121 y_[i] = data_->interpl_[i](
t,
true);
124 const Real expectation
126 const Real stdDeviation
129 const Real r =
sigma_*(x-expectation)/stdDeviation;
131 return data_->lagrangeInterpl_.value(y_,
r);
Analytic European engine.
1-D array used in linear algebra.
Size size() const
dimension of the array
Cumulative normal distribution function.
generalized Gauss-Hermite integration
Inverse cumulative normal distribution function.
virtual void calculate() const
const ext::shared_ptr< InterpolationData > data_
Real operator()(Time t, Real x) const
MappingFunction(const NormalCLVModel &model)
const std::vector< Date > maturityDates_
void performCalculations() const override
std::vector< Time > maturityTimes_
const ext::shared_ptr< GeneralizedBlackScholesProcess > bsProcess_
NormalCLVModel(const ext::shared_ptr< GeneralizedBlackScholesProcess > &bsProcess, ext::shared_ptr< OrnsteinUhlenbeckProcess > ouProcess, const std::vector< Date > &maturityDates, Size lagrangeOrder, Real pMax=Null< Real >(), Real pMin=Null< Real >())
Real invCDF(const Date &d, Real q) const
Real cdf(const Date &d, Real x) const
ext::function< Real(Time, Real)> g_
const ext::shared_ptr< OrnsteinUhlenbeckProcess > ouProcess_
const ext::shared_ptr< GBSMRNDCalculator > rndCalculator_
Array collocationPointsX(const Date &d) const
Array collocationPointsY(const Date &d) const
ext::function< Real(Time, Real)> g() const
template class providing a null value for a given type.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Option exercise classes and payoff function.
Integral of a 1-dimensional function using the Gauss quadratures.
risk neutral terminal density calculator for the Black-Scholes-Merton model with skew dependent volat...
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container
linear interpolation between discrete points
CLV model with a normally distributed kernel process.
normal, cumulative and inverse cumulative distributions
Ornstein-Uhlenbeck process.
ext::shared_ptr< YieldTermStructure > q
ext::shared_ptr< YieldTermStructure > r
Vanilla option on a single asset.