32 {
33
34
35 Size n_samples = z.size();
36
37 std::pair<Real, Real> Vs =
cam_->infdkV(i, t, T);
38 RandomVariable V0(n_samples, Vs.first);
39 RandomVariable V_tilde(n_samples, Vs.second);
40 RandomVariable Hyt(n_samples,
cam_->infdk(i)->H(t));
41 RandomVariable HyT(n_samples,
cam_->infdk(i)->H(T));
42
43
44
45 const auto& zts =
cam_->infdk(i)->termStructure();
46 auto dc =
cam_->irlgm1f(0)->termStructure()->dayCounter();
47 RandomVariable growth_t(n_samples,
inflationGrowth(zts, t, dc, indexIsInterpolated));
48 RandomVariable growth_T(n_samples,
inflationGrowth(zts, T, dc, indexIsInterpolated));
49
50
51
52 RandomVariable It = growth_t *
exp(Hyt * z - y - V0);
53 RandomVariable Itilde_t_T = growth_T / growth_t *
exp((HyT - Hyt) * z + V_tilde);
54
55
56
57
58
59 return std::make_pair(It, Itilde_t_T);
60 }
CompiledFormula exp(CompiledFormula x)
Real inflationGrowth(const QuantLib::ext::shared_ptr< CrossAssetModel > &model, Size index, Time S, Time T, Real irState, Real rrState, bool indexIsInterpolated)