19#include <boost/make_shared.hpp>
20#include <ql/math/distributions/chisquaredistribution.hpp>
21#include <ql/math/distributions/normaldistribution.hpp>
22#include <ql/processes/eulerdiscretization.hpp>
31 discretization_(disc) {}
36 Array res(
size(), 0.0);
43 QL_FAIL(
"not implemented");
47 QL_FAIL(
"not implemented");
52 Real kappa, theta, sigma, y0;
58 const Real sdt = std::sqrt(dt);
65 Real temp = (1 - kappa / 2.0 * dt);
66 Real temp2 = temp * std::sqrt(x0[0]) + sigma * sdt * dw[0] / (2.0 * temp);
67 retVal[0] = temp2 * temp2 + (kappa * theta - sigma * sigma / 4) * dt;
71 QL_FAIL(
"unknown discretization schema");
79 retVal[1] = x0[1] * SM_ti / SM_ti_pre * Pcir_ti_pre / Pcir_ti *
exp(-x0[0] * dt);
Cox-Ingersoll-Ross ++ credit model class.
Real zeroBond(Real t, Real T, Real y) const
Handle< DefaultProbabilityTermStructure > defaultCurve(std::vector< Date > dateGrid=std::vector< Date >()) const
const QuantLib::ext::shared_ptr< CrCirppParametrization > parametrization() const
Array drift(Time t, const Array &x) const override
Size size() const override
Array evolve(Time t0, const Array &x0, Time dt, const Array &dw) const override
CrCirppStateProcess(CrCirpp *const model, CrCirppStateProcess::Discretization disc=CrCirppStateProcess::Discretization::BrigoAlfonsi)
Matrix diffusion(Time t, const Array &x) const override
Array initialValues() const override
const CrCirppStateProcess::Discretization discretization_
CIR++ credit model class.
CIR++ model state process.
CompiledFormula exp(CompiledFormula x)