Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
InfDkVectorised Class Reference

#include <qle/models/infdkvectorised.hpp>

+ Collaboration diagram for InfDkVectorised:

Public Member Functions

 InfDkVectorised (const QuantLib::ext::shared_ptr< CrossAssetModel > &cam)
 
std::pair< RandomVariable, RandomVariableinfdkI (const Size i, const Time t, const Time T, const RandomVariable &z, const RandomVariable &y, bool indexIsInterpolated) const
 

Private Attributes

const QuantLib::ext::shared_ptr< CrossAssetModelcam_
 

Detailed Description

Definition at line 36 of file infdkvectorised.hpp.

Constructor & Destructor Documentation

◆ InfDkVectorised()

InfDkVectorised ( const QuantLib::ext::shared_ptr< CrossAssetModel > &  cam)

Definition at line 24 of file infdkvectorised.cpp.

25 : cam_(cam) {
26
27 }
const QuantLib::ext::shared_ptr< CrossAssetModel > cam_

Member Function Documentation

◆ infdkI()

std::pair< RandomVariable, RandomVariable > infdkI ( const Size  i,
const Time  t,
const Time  T,
const RandomVariable z,
const RandomVariable y,
bool  indexIsInterpolated 
) const

Definition at line 29 of file infdkvectorised.cpp.

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 // TODO account for seasonality ...
44 // compute final results depending on z and y
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 // Vectorize the scalars
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 // concerning interpolation there is an inaccuracy here: if the index
55 // is not interpolated, we still simulate the index value as of t
56 // (and T), although we should go back to t, T which corresponds to
57 // the last actual publication time of the index => is the approximation
58 // here in this sense good enough that we can tolerate this?
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)
+ Here is the call graph for this function:

Member Data Documentation

◆ cam_

const QuantLib::ext::shared_ptr<CrossAssetModel> cam_
private

Definition at line 44 of file infdkvectorised.hpp.