21#include <ql/math/distributions/normaldistribution.hpp>
31 const Size ny,
const Real
sx,
const Size nx)
32 : model_(model), nx_(nx) {
37 mx_ =
static_cast<Size
>(floor(
sx *
static_cast<Real
>(nx)) + 0.5);
38 my_ =
static_cast<Size
>(floor(
sy *
static_cast<Real
>(ny)) + 0.5);
41 h_ = 1.0 /
static_cast<Real
>(ny);
44 CumulativeNormalDistribution N;
47 y_.resize(2 *
my_ + 1);
48 w_.resize(2 *
my_ + 1);
49 for (
int i = 0; i <= 2 *
my_; i++) {
51 if (i == 0 || i == 2 *
my_)
59 QL_REQUIRE(
w_[i] > -1.0E-10,
"LgmConvolutionSolver: negative w (" <<
w_[i] <<
") at i=" << i);
67 return std::vector<Real>(2 *
mx_ + 1, 0.0);
68 std::vector<Real> x(2 *
mx_ + 1);
69 Real dx = std::sqrt(
model_->parametrization()->zeta(t)) /
static_cast<Real
>(
nx_);
70 for (
int k = 0; k <= 2 *
mx_; ++k) {
71 x[k] = dx * (k -
mx_);
LgmConvolutionSolver(const QuantLib::ext::shared_ptr< LinearGaussMarkovModel > &model, const Real sy, const Size ny, const Real sx, const Size nx)
Numerical convolution solver for the LGM model.
std::vector< Real > stateGrid(const Real t) const
QuantLib::ext::shared_ptr< LinearGaussMarkovModel > model_
numeric convolution solver for the LGM model
Filter close_enough(const RandomVariable &x, const RandomVariable &y)
JY INF index sigma component.