26 const ext::shared_ptr<LmCorrelationModel>& corrModel)
29 volaModel_(
std::move(volaModel)), corrModel_(corrModel) {
32 "different size for the volatility (" <<
volaModel_->size() <<
37 ext::shared_ptr<LmVolatilityModel>
42 ext::shared_ptr<LmCorrelationModel>
54 [&](
Real x) ->
Real { return x * vol[i]; });
68 tmp[i][j] = volatility[i]*correlation[i][j]*volatility[j];
75 class LfmCovarianceProxy::Var_Helper {
86 LfmCovarianceProxy::Var_Helper::Var_Helper(
const LfmCovarianceProxy* proxy,
90 volaModel_(proxy->volaModel_.get()),
91 corrModel_(proxy->corrModel_.get()) {
94 Real LfmCovarianceProxy::Var_Helper::operator()(
Real t)
const {
98 v1 = v2 = volaModel_->volatility(i_,
t);
100 v1 = volaModel_->volatility(i_,
t);
101 v2 = volaModel_->volatility(j_,
t);
104 return v1 * corrModel_->correlation(i_, j_,
t) * v2;
127 Var_Helper helper(
this, i, j);
130 for (
Size k=0; k<64; ++k) {
131 tmp+=integrator(helper, k*
t/64., (k+1)*
t/64.);
1-D array used in linear algebra.
bool empty() const
whether the array is empty
Integral of a 1-dimensional function using the Gauss-Kronrod methods.
Libor market model parameterization
proxy for a libor forward model covariance parameterization
Matrix covariance(Time t, const Array &x=Null< Array >()) const override
Matrix diffusion(Time t, const Array &x=Null< Array >()) const override
ext::shared_ptr< LmVolatilityModel > volatilityModel() const
ext::shared_ptr< LmCorrelationModel > correlationModel() const
virtual Real integratedCovariance(Size i, Size j, Time t, const Array &x=Null< Array >()) const
const ext::shared_ptr< LmCorrelationModel > corrModel_
LfmCovarianceProxy(ext::shared_ptr< LmVolatilityModel > volaModel, const ext::shared_ptr< LmCorrelationModel > &corrModel)
const ext::shared_ptr< LmVolatilityModel > volaModel_
libor forward correlation model
Matrix used in linear algebra.
const_row_iterator row_begin(Size i) const
const_row_iterator row_end(Size i) const
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Real Time
continuous quantity with 1-year units
Real Volatility
volatility
std::size_t Size
size of a container
Integral of a 1-dimensional function using the Gauss-Kronrod method.
proxy for libor forward covariance parameterization