Logo
Reference manual - version qle_version
Cross Asset Model

Files

file  crossassetanalytics.hpp
 analytics for the cross asset model
file  crossassetanalyticsbase.hpp
 basic functions for analytics in the cross asset model
file  crossassetmodel.hpp
 cross asset model
file  crossassetmodelimpliedeqvoltermstructure.hpp
 dynamic black volatility term structure
file  crossassetmodelimpliedfxvoltermstructure.hpp
 dynamic black volatility term structure
file  crossassetmodelimpliedswaptionvoltermstructure.hpp
 dynamic Swpation volatility term structure
file  projectedcrossassetmodel.hpp
 cross asset model projection utils
file  crossassetstateprocess.hpp
 crossasset model state process

Classes

struct  Hz
struct  az
struct  zetaz
struct  sx
struct  vx
struct  Hy
 INF H component. May relate to real rate portion of JY model or z component of DK model. More...
struct  ay
 INF alpha component. May relate to real rate portion of JY model or z component of DK model. More...
struct  zetay
 INF zeta component. May relate to real rate portion of JY model or z component of DK model. More...
struct  sy
 JY INF index sigma component. More...
struct  vy
 JY INF index variance component. More...
struct  Hl
struct  al
struct  zetal
struct  ss
struct  vs
struct  coms
struct  comDiffusionIntegrand
struct  rzz
struct  rzx
struct  rxx
struct  ryy
struct  rzy
struct  rxy
struct  rll
struct  rzl
struct  rxl
struct  ryl
struct  rss
struct  rzs
struct  rxs
struct  rys
struct  rls
struct  rcc
struct  rzc
struct  rxc
struct  ryc
struct  rsc
struct  rlc
struct  HTtz
struct  rzcrs
struct  rxcrs
struct  rccrs
struct  P2_< E1, E2 >
struct  P3_< E1, E2, E3 >
struct  P4_< E1, E2, E3, E4 >
struct  P5_< E1, E2, E3, E4, E5 >
struct  LC1_< E1 >
struct  LC2_< E1, E2 >
struct  LC3_< E1, E2, E3 >
struct  LC4_< E1, E2, E3, E4 >
class  CrossAssetModel
 Cross Asset Model. More...
class  CrossAssetModelImpliedEqVolTermStructure
 Cross Asset Model Implied EQ Term Structure. More...
class  CrossAssetModelImpliedFxVolTermStructure
 Cross Asset Model Implied FX Term Structure. More...
class  CrossAssetModelImpliedSwaptionVolTermStructure
 Cross Asset Model Implied Swaption Vol Term Structure. More...
class  CrossAssetStateProcess
 Cross Asset Model State Process. More...

Functions

Real ir_expectation_1 (const CrossAssetModel &model, const Size i, const Time t0, const Real dt)
Real ir_expectation_2 (const CrossAssetModel &model, const Size i, const Real zi_0)
std::pair< QuantLib::Real, QuantLib::Real > inf_jy_expectation_1 (const CrossAssetModel &model, QuantLib::Size i, QuantLib::Time t0, QuantLib::Real dt)
std::pair< QuantLib::Real, QuantLib::Real > inf_jy_expectation_2 (const CrossAssetModel &model, QuantLib::Size i, QuantLib::Time t0, const std::pair< QuantLib::Real, QuantLib::Real > &state_0, QuantLib::Real zi_i_0, QuantLib::Real dt)
Real fx_expectation_1 (const CrossAssetModel &model, const Size i, const Time t0, const Real dt)
Real fx_expectation_2 (const CrossAssetModel &model, const Size i, const Time t0, const Real xi_0, const Real zi_0, const Real z0_0, const Real dt)
Real eq_expectation_1 (const CrossAssetModel &model, const Size i, const Time t0, const Real dt)
Real eq_expectation_2 (const CrossAssetModel &model, const Size k, const Time t0, const Real si_0, const Real zi_0, const Real dt)
Real com_expectation_1 (const CrossAssetModel &model, const Size i, const Time t0, const Real dt)
Real ir_ir_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real ir_fx_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real fx_fx_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real infz_infz_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real infz_infy_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real infy_infy_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real ir_infz_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real ir_infy_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real fx_infz_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real fx_infy_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real crz_crz_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real crz_cry_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real cry_cry_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real ir_crz_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real ir_cry_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real fx_crz_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real fx_cry_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real infz_crz_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real infz_cry_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real infy_crz_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real infy_cry_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real ir_eq_covariance (const CrossAssetModel &model, const Size irIdx, const Size eqIdx, const Time t0, const Time dt)
Real fx_eq_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real infz_eq_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real infy_eq_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real crz_eq_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real cry_eq_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real eq_eq_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real aux_aux_covariance (const CrossAssetModel &model, const Time t0, const Time dt)
Real aux_ir_covariance (const CrossAssetModel &model, const Size j, const Time t0, const Time dt)
Real aux_fx_covariance (const CrossAssetModel &model, const Size j, const Time t0, const Time dt)
Real com_com_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real ir_com_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real fx_com_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real infz_com_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real infy_com_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real cry_com_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real crz_com_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real eq_com_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real ir_crstate_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real fx_crstate_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
Real crstate_crstate_covariance (const CrossAssetModel &model, const Size i, const Size j, const Time t0, const Time dt)
template<class E>
Real integral_helper (const CrossAssetModel &x, const E &e, const Real t)
template<typename E>
Real integral (const CrossAssetModel &model, const E &e, const Real a, const Real b)
template<class E1, class E2>
const P2_< E1, E2 > P (const E1 &e1, const E2 &e2)
template<class E1, class E2, class E3>
const P3_< E1, E2, E3 > P (const E1 &e1, const E2 &e2, const E3 &e3)
template<class E1, class E2, class E3, class E4>
const P4_< E1, E2, E3, E4 > P (const E1 &e1, const E2 &e2, const E3 &e3, const E4 &e4)
template<class E1, class E2, class E3, class E4, class E5>
const P5_< E1, E2, E3, E4, E5 > P (const E1 &e1, const E2 &e2, const E3 &e3, const E4 &e4, const E5 &e5)
template<class E1>
const LC1_< E1 > LC (QuantLib::Real c, QuantLib::Real c1, const E1 &e1)
template<class E1, class E2>
const LC2_< E1, E2 > LC (QuantLib::Real c, QuantLib::Real c1, const E1 &e1, QuantLib::Real c2, const E2 &e2)
template<class E1, class E2, class E3>
const LC3_< E1, E2, E3 > LC (QuantLib::Real c, QuantLib::Real c1, const E1 &e1, QuantLib::Real c2, const E2 &e2, QuantLib::Real c3, const E3 &e3)
template<class E1, class E2, class E3, class E4>
const LC4_< E1, E2, E3, E4 > LC (QuantLib::Real c, QuantLib::Real c1, const E1 &e1, QuantLib::Real c2, const E2 &e2, QuantLib::Real c3, const E3 &e3, QuantLib::Real c4, const E4 &e4)

Detailed Description

Grouping of all cross asset models

Function Documentation

◆ ir_expectation_1()

Real ir_expectation_1 ( const CrossAssetModel & model,
const Size i,
const Time t0,
const Real dt )

IR state expectation

This function evaluates part of the expectation \( \mathbb{E}_{t_0}[z_i(t_0+dt)]\).

Using the results above for factor moves \(\Delta z\) over time interval \((s,t)\), we have

\begin{eqnarray}\mathbb{E}_{t_0}[z_i(t_0+\Delta t)] &=& z_i(t_0) + \mathbb{E}_{t_0}[\Delta z_i], \qquad\mbox{with}\quad \Delta z_i = z_i(t_0+\Delta t) - z_i(t_0) \\ &=& z_i(t_0) -\int_{t_0}^{t_0+\Delta t} H^z_i\,(\alpha^z_i)^2\,du + \rho^{zz}_{0i} \int_{t_0}^{t_0+\Delta t} H^z_0\,\alpha^z_0\,\alpha^z_i\,du - \epsilon_i \rho^{zx}_{ii}\int_{t_0}^{t_0+\Delta t} \sigma_i^x\,\alpha^z_i\,du \end{eqnarray}

This function covers the latter three integrals, the state-independent part.

◆ ir_expectation_2()

Real ir_expectation_2 ( const CrossAssetModel & model,
const Size i,
const Real zi_0 )

IR state expectation This function evaluates the state-dependent part of the expectation

\begin{eqnarray}\mathbb{E}_{t_0}[z_i(t_0+\Delta t)] &=& z_i(t_0) -\int_{t_0}^{t_0+\Delta t} H^z_i\,(\alpha^z_i)^2\,du + \rho^{zz}_{0i} \int_{t_0}^{t_0+\Delta t} H^z_0\,\alpha^z_0\,\alpha^z_i\,du - \epsilon_i \rho^{zx}_{ii}\int_{t_0}^{t_0+\Delta t} \sigma_i^x\,\alpha^z_i\,du \end{eqnarray}

i.e. simply the first contribution \( z_i(t_0) \).

◆ inf_jy_expectation_1()

std::pair< QuantLib::Real, QuantLib::Real > inf_jy_expectation_1 ( const CrossAssetModel & model,
QuantLib::Size i,
QuantLib::Time t0,
QuantLib::Real dt )

State independent portion of the JY inflation drift. The first element of the pair relates to the real rate process and the second element of the pair relates to the inflation index process.

◆ inf_jy_expectation_2()

std::pair< QuantLib::Real, QuantLib::Real > inf_jy_expectation_2 ( const CrossAssetModel & model,
QuantLib::Size i,
QuantLib::Time t0,
const std::pair< QuantLib::Real, QuantLib::Real > & state_0,
QuantLib::Real zi_i_0,
QuantLib::Real dt )

State dependent portion of the JY inflation drift. The first element of the pair relates to the real rate process and the second element of the pair relates to the inflation index process.

◆ fx_expectation_1()

Real fx_expectation_1 ( const CrossAssetModel & model,
const Size i,
const Time t0,
const Real dt )

FX state expectation

This function evaluates part of the expectation \( \mathbb{E}_{t_0}[\ln x_i(t_0+dt)]\).

Using the results above for factor moves \(\Delta \ln x\) over time interval \((s,t)\), we have

\begin{eqnarray}\mathbb{E}_{t_0}[\ln x_i(t_0+\Delta t)] &=& \ln x_i(t_0) + \mathbb{E}_{t_0}[\Delta \ln x_i], \qquad\mbox{with}\quad \Delta \ln x_i = \ln x_i(t_0+\Delta t) - \ln x_i(t_0) \\ &=& \ln x_i(t_0) + \left(H^z_0(t)-H^z_0(s)\right) z_0(s) -\left(H^z_i(t)-H^z_i(s)\right)z_i(s)\\ &&+ \ln \left( \frac{P^n_0(0,s)}{P^n_0(0,t)} \frac{P^n_i(0,t)}{P^n_i(0,s)}\right) \\ && - \frac12 \int_s^t (\sigma^x_i)^2\,du \\ &&+\frac12 \left((H^z_0(t))^2 \zeta^z_0(t) - (H^z_0(s))^2 \zeta^z_0(s)- \int_s^t (H^z_0)^2 (\alpha^z_0)^2\,du\right)\\ &&-\frac12 \left((H^z_i(t))^2 \zeta^z_i(t) - (H^z_i(s))^2 \zeta^z_i(s)-\int_s^t (H^z_i)^2 (\alpha^z_i)^2\,du \right)\\ && + \rho^{zx}_{0i} \int_s^t H^z_0\, \alpha^z_0\, \sigma^x_i\,du \\ && - \int_s^t \left(H^z_i(t)-H^z_i\right)\gamma_i \,du, \qquad\mbox{with}\quad s = t_0, \quad t = t_0+\Delta t \end{eqnarray}

where we rearranged terms so that the state-dependent terms are listed on the first line (containing \(\ln x_i(t_0), z_i(t_0), z_0(t_0) \)) and all following terms are state-independent (deterministic, just dependent on initial market data and model parameters).

The last integral above contains \(\gamma_i\) which is (see documentation of the CrossAssetModel)

\[\gamma_i = -H^z_i\,(\alpha^z_i)^2 + H^z_0\,\alpha^z_0\,\alpha^z_i\,\rho^{zz}_{0i} - \sigma_i^x\,\alpha^z_i\, \rho^{zx}_{ii}. \]

The very last last integral above is therefore broken up into six terms which we do not list here, but which show up in this function's implementation.

This function covers the latter state-independent part of the FX expectation.

◆ fx_expectation_2()

Real fx_expectation_2 ( const CrossAssetModel & model,
const Size i,
const Time t0,
const Real xi_0,
const Real zi_0,
const Real z0_0,
const Real dt )

FX state expectation.

This function covers the state-dependent part of the FX expectation.

◆ eq_expectation_1()

Real eq_expectation_1 ( const CrossAssetModel & model,
const Size i,
const Time t0,
const Real dt )

EQ state expectation

This function covers part of the EQ expectation. The overall expectation formula (taken from the book "Modern Derivatives Pricing and Credit Exposure Analysis" by Lichters, Stamm and Gallagher) is as follows:

\begin{eqnarray} \mathbb{E} \left[\Delta ln[s_k]\right] &=& ln \left[ \frac{P_{\phi(k)}(0,s)}{P_{\phi(k)}(0,t)} \right] - \int_{s}^{t} q_k(u) du - \frac{1}{2} \int_{s}^{t}\sigma_{s_k}^2(u) du\\ && +\rho_{z_0,s_k}\int_{s}^{t}\alpha_0(u) H_0(u) \sigma_{s_k}(u) du - \epsilon_{\phi(k)} \rho_{s_k,x_{\phi(k)}} \int_{s}^{t} \sigma_{s_k}(u)\sigma_{x_{\phi(k)}}(u) du\\ &&+\frac{1}{2} \left( H_{\phi(k)}^2(t) \zeta_{\phi(k)}(t) - H_{\phi(k)}^2(s) \zeta_{\phi(k)}(s) - \int_{s}^{t} H_{\phi(k)}^2(u) \alpha_{\phi(k)}^2(u) du \right)\\ && + (H_{\phi(k)}(t) - H_{\phi(k)}(s)) z_{\phi(k)}(s) +\epsilon_{\phi(k)} \int_{s}^{t} \gamma_{\phi(k)} (u) (H_{\phi(k)}(t) - H_{\phi(k)}(u)) du,\\ && \qquad\mbox{with}\quad s = t_0, \quad t = t_0+\Delta t, \quad \phi(k) = \qquad\mbox{ interest rate for currency of equity k} \end{eqnarray}

This function covers the state-independent part of the EQ expectation

◆ eq_expectation_2()

Real eq_expectation_2 ( const CrossAssetModel & model,
const Size k,
const Time t0,
const Real si_0,
const Real zi_0,
const Real dt )

EQ state expectation

This function covers the state-dependent part of the EQ expectation (see overall expression above).

◆ ir_ir_covariance()

Real ir_ir_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

IR-IR Covariance

This function evaluates the covariance term

\f{eqnarray*}{
\mathrm{Cov}[\Delta z_a, \Delta z_b] &=& \rho^{zz}_{ab} \int_s^t \alpha^z_a\,\alpha^z_b\,du
\f}

on the time interval from \f$ s= t_0\f$ to \f$ t=t_0+\Delta t\f$.

◆ ir_fx_covariance()

Real ir_fx_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

IR-FX Covariance

This function evaluates the covariance term

\begin{eqnarray} \mathrm{Cov} [\Delta z_a, \Delta \ln x_b]) &=& \rho^{zz}_{0a}\int_s^t \left(H^z_0(t)-H^z_0\right) \alpha^z_0\,\alpha^z_a\,du \nonumber\\ &&- \rho^{zz}_{ab}\int_s^t \alpha^z_a \left(H^z_b(t)-H^z_b\right) \alpha^z_b \,du \nonumber\\ &&+\rho^{zx}_{ab}\int_s^t \alpha^z_a \, \sigma^x_b \,du. \end{eqnarray}

on the time interval from \( s= t_0\) to \( t=t_0+\Delta t\).

◆ fx_fx_covariance()

Real fx_fx_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

FX-FX covariance

This function evaluates the covariance term

\begin{eqnarray} \mathrm{Cov}[\Delta \ln x_a, \Delta \ln x_b] &=& \int_s^t \left(H^z_0(t)-H^z_0\right)^2 (\alpha_0^z)^2\,du \nonumber\\ && -\rho^{zz}_{0a} \int_s^t \left(H^z_a(t)-H^z_a\right) \alpha_a^z\left(H^z_0(t)-H^z_0\right) \alpha_0^z\,du \nonumber\\ &&- \rho^{zz}_{0b}\int_s^t \left(H^z_0(t)-H^z_0\right)\alpha_0^z \left(H^z_b(t)-H^z_b\right)\alpha_b^z\,du \nonumber\\ &&+ \rho^{zx}_{0b}\int_s^t \left(H^z_0(t)-H^z_0\right)\alpha_0^z \sigma^x_b\,du \nonumber\\ &&+ \rho^{zx}_{0a}\int_s^t \left(H^z_0(t)-H^z_0\right)\alpha_0^z\,\sigma^x_a\,du \nonumber\\ &&- \rho^{zx}_{ab}\int_s^t \left(H^z_a(t)-H^z_a\right)\alpha_a^z \sigma^x_b,du\nonumber\\ &&- \rho^{zx}_{ba}\int_s^t \left(H^z_b(t)-H^z_b\right)\alpha_b^z\,\sigma^x_a\, du \nonumber\\ &&+ \rho^{zz}_{ab}\int_s^t \left(H^z_a(t)-H^z_a\right)\alpha_a^z \left(H^z_b(t)-H^z_b\right)\alpha_b^z\,du \nonumber\\ &&+ \rho^{xx}_{ab}\int_s^t\sigma^x_a\,\sigma^x_b \,du \end{eqnarray}

on the time interval from \( s= t_0\) to \( t=t_0+\Delta t\).

The implementation of this FX-FX covariance in this function further decomposes all terms in order to separate simple and more complex integrations and to allow for tailored efficient numerical integration schemes. Line by line, the covariance above can be written:

\begin{eqnarray} \mathrm{Cov}[\Delta \ln x_a, \Delta \ln x_b] &=& (H^z_0)^2(t)\int_s^t (\alpha_0^z)^2\,du - 2 \,H^z_0(t)\int_s^t H^z_0 (\alpha_0^z)^2\,du + \int_s^t (H^z_0\,\alpha_0^z)^2\,du \\ && - \rho^{zz}_{0a} H^z_0(t) \,H^z_a(t)\int_s^t \alpha_0^z\,\alpha_a^z\,du + \rho^{zz}_{0a} H^z_a(t) \int_s^t H^z_0\,\alpha_0^z\,\alpha_a^z\,du + \rho^{zz}_{0a} H^z_0(t) \int_s^t H^z_a\,\alpha_0^z\,\alpha_a^z\,du - \rho^{zz}_{0a}\int_s^t H^z_0\,H^z_a\,\alpha_0^z\,\alpha_a^z\,du \\ && - \rho^{zz}_{0b} H^z_0(t) \,H^z_b(t)\int_s^t \alpha_0^z\,\alpha_b^z\,du + \rho^{zz}_{0b} H^z_b(t) \int_s^t H^z_0\,\alpha_0^z\,\alpha_b^z\,du + \rho^{zz}_{0b} H^z_0(t) \int_s^t H^z_b\,\alpha_0^z\,\alpha_b^z\,du - \rho^{zz}_{0b}\int_s^t H^z_0\,H^z_b\,\alpha_0^z\,\alpha_b^z\,du \\ && + \rho^{zx}_{0b} H^z_0(t) \int_s^t \alpha_0^z \,\sigma^x_b\,du - \rho^{zx}_{0b} \int_s^t H^z_0 \,\alpha_0^z \,\sigma^x_b\,du \\ && + \rho^{zx}_{0a} H^z_0(t) \int_s^t \alpha_0^z \,\sigma^x_a\,du - \rho^{zx}_{0a} \int_s^t H^z_0 \,\alpha_0^z \,\sigma^x_a\,du \\ && - \rho^{zx}_{ab} H^z_a(t) \int_s^t \alpha_a^z \sigma^x_b,du + \rho^{zx}_{ab} \int_s^t H^z_a\,\alpha_a^z \sigma^x_b,du \\ && - \rho^{zx}_{ba} H^z_b(t) \int_s^t \alpha_b^z \sigma^x_a,du + \rho^{zx}_{ba} \int_s^t H^z_b\,\alpha_b^z \sigma^x_a,du \\ && + \rho^{zz}_{ab} H^z_a(t) H^z_b(t) \int_s^t \alpha_a^z \alpha_b^z \,du - \rho^{zz}_{ab} H^z_b(t) \int_s^t H^z_a \alpha_a^z \alpha_b^z \,du - \rho^{zz}_{ab} H^z_a(t) \int_s^t H^z_b \alpha_a^z \alpha_b^z \,du + \rho^{zz}_{ab} \int_s^t H^z_a H^z_b \alpha_a^z \alpha_b^z \,du \\ && + \rho^{xx}_{ab} \int_s^t\sigma^x_a\,\sigma^x_b \,du \end{eqnarray}

When comparing with the code, also note that the integral on line one can be simplified to

\[ \int_s^t (\alpha_0^z)^2\,du = \zeta_0(t) - \zeta_0(s) \]

◆ infz_infz_covariance()

Real infz_infz_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

infz-infz covariance

◆ infz_infy_covariance()

Real infz_infy_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

infz-infy covariance

◆ infy_infy_covariance()

Real infy_infy_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

infy-infy covariance

◆ ir_infz_covariance()

Real ir_infz_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

ir-infz covariance

◆ ir_infy_covariance()

Real ir_infy_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

ir-infy covariance

◆ fx_infz_covariance()

Real fx_infz_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

fx-infz covariance

◆ fx_infy_covariance()

Real fx_infy_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

fx-infy covariance

◆ crz_crz_covariance()

Real crz_crz_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

crz-crz covariance

◆ crz_cry_covariance()

Real crz_cry_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

crz-cry covariance

◆ cry_cry_covariance()

Real cry_cry_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

cry-cry covariance

◆ ir_crz_covariance()

Real ir_crz_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

ir-crz covariance

◆ ir_cry_covariance()

Real ir_cry_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

ir-cry covariance

◆ fx_crz_covariance()

Real fx_crz_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

fx-crz covariance

◆ fx_cry_covariance()

Real fx_cry_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

fx-cry covariance

◆ infz_crz_covariance()

Real infz_crz_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

infz-crz covariance

◆ infz_cry_covariance()

Real infz_cry_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

infz-cry covariance

◆ infy_crz_covariance()

Real infy_crz_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

infy-crz covariance

◆ infy_cry_covariance()

Real infy_cry_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

infy-cry covariance

◆ ir_eq_covariance()

Real ir_eq_covariance ( const CrossAssetModel & model,
const Size irIdx,
const Size eqIdx,
const Time t0,
const Time dt )

IR-EQ Covariance

\begin{eqnarray}Cov \left[\Delta ln[s_i], \Delta z_j \right] &=& \rho_{z_{\phi(i)},z_j} \int_{s}^{t} (H_{\phi(i)} (t) - H_{\phi(i)} (u)) \alpha_{\phi(i)} (u) \alpha_j (u) du\\ &&+ \rho_{s_i,z_j} \int_{s}^{t} \sigma_{s_i} (u) \alpha_j (u) du\\ \end{eqnarray}

◆ fx_eq_covariance()

Real fx_eq_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

FX-EQ Covariance

\begin{eqnarray}Cov \left[\Delta ln[s_i], \Delta ln[x_j] \right] &=& \rho_{z_{\phi(i)},z_0} \int_{s}^{t} (H_{\phi(i)} (t) - H_{\phi(i)} (u)) (H_0 (t) - H_0 (u)) \alpha_{\phi(i)}(u) \alpha_0(u) du\\ && - \rho_{z_{\phi(i)},z_j} \int_{s}^{t} (H_{\phi(i)} (t) - H_{\phi(i)} (u)) (H_j (t) - H_j (u)) \alpha_{\phi(i)} (u)\alpha_j(u) du\\ && + \rho_{z_{\phi(i)},x_j} \int_{s}^{t} (H_{\phi(i)} (t) - H_{\phi(i)} (u)) \alpha_{\phi(i)} (u) \sigma_{x_j}(u) du\\ &&+ \rho_{s_i,z_0} \int_{s}^{t} (H_0 (t) - H_0 (u)) \alpha_0 (u) \sigma_{s_i}(u) du\\ &&- \rho_{s_i,z_j} \int_{s}^{t} (H_j (t) - H_j (u)) \alpha_j (u) \sigma_{s_i}(u) du\\ &&+ \rho_{s_i,x_j} \int_{s}^{t} \sigma_{s_i}(u) \sigma_{x_j}(u) du\\ \end{eqnarray}

◆ infz_eq_covariance()

Real infz_eq_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

infz-eq covariance

◆ infy_eq_covariance()

Real infy_eq_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

infy-eq covariance

◆ crz_eq_covariance()

Real crz_eq_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

crz-eq covariance

◆ cry_eq_covariance()

Real cry_eq_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

cry-eq covariance

◆ eq_eq_covariance()

Real eq_eq_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

EQ-EQ Covariance

\begin{eqnarray}Cov \left[\Delta ln[s_i], \Delta ln[s_j] \right] &=& \rho_{z_{\phi(i)},z_{\phi(j)}} \int_{s}^{t} (H_{\phi(i)} (t) - H_{\phi(i)} (u)) (H_{\phi(j)} (t)\\ && - H_{\phi(j)} (u)) \alpha_{\phi(i)}(u) \alpha_{\phi(j)}(u) du\\ &&+ \rho_{z_{\phi(i)},s_j} \int_{s}^{t} (H_{\phi(i)} (t) - H_{\phi(i)} (u)) \alpha_{\phi(i)}(u) \sigma_{s_j}(u) du\\ &&+ \rho_{z_{\phi(j)},s_i} \int_{s}^{t} (H_{\phi(j)} (t) - H_{\phi(j)} (u)) \alpha_{\phi(j)}(u) \sigma_{s_i}(u) du\\ &&+ \rho_{s_i,s_j} \int_{s}^{t} \sigma_{s_i}(u) \sigma_{s_j}(u) du\\ \end{eqnarray}

◆ aux_aux_covariance()

Real aux_aux_covariance ( const CrossAssetModel & model,
const Time t0,
const Time dt )

AUX-AUX Covariance

This function evaluates the covariance term for the domestic auxiliary state variable in the bank account measure

\f{eqnarray*}{
\mathrm{Cov}[\Delta y_0, \Delta y_0] &=& \int_s^t (\alpha^z_0)^2 \,(H^z_0)^2\,du
\f}

on the time interval from \f$ s= t_0\f$ to \f$ t=t_0+\Delta t\f$.

◆ aux_ir_covariance()

Real aux_ir_covariance ( const CrossAssetModel & model,
const Size j,
const Time t0,
const Time dt )

AUX-IR Covariance

This function evaluates the covariance term for the domestic auxiliary state variable in the bank account measure with any other LGM state variable

\f{eqnarray*}{
\mathrm{Cov}[\Delta y_0, \Delta z_b] &=& \rho^{zz}_{0b} \int_s^t H^z_0\,\alpha^z_0\,\alpha^z_b\,du
\f}

on the time interval from \f$ s= t_0\f$ to \f$ t=t_0+\Delta t\f$.

◆ aux_fx_covariance()

Real aux_fx_covariance ( const CrossAssetModel & model,
const Size j,
const Time t0,
const Time dt )

AUX-FX Covariance

This function evaluates the covariance term

\begin{eqnarray} \mathrm{Cov} [\Delta y_0, \Delta \ln x_b]) &=& \int_s^t \left(H^z_0(t)-H^z_0\right) (\alpha^z_0)^2\,H^z_0\,du \nonumber\\ &&- \rho^{zz}_{0b}\int_s^t \alpha^z_0\,H^z_0 \left(H^z_b(t)-H^z_b\right) \alpha^z_b \,du \nonumber\\ &&+\rho^{zx}_{0b}\int_s^t \alpha^z_0\,H^z_0 \, \sigma^x_b \,du. \end{eqnarray}

on the time interval from \( s= t_0\) to \( t=t_0+\Delta t\).

◆ com_com_covariance()

Real com_com_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

COM-COM state variable covariance, mean-reverting single-factor case

\begin{eqnarray}Cov \left[\Delta Y_i, \Delta Y_j] \right] &=& \rho_{Y_i,Y_j} \int_{s}^{t} \sigma_{Y_i}(u) \exp(\kappa_i u) \sigma_{Y_j}(u) \exp(\kappa_j u) du\\ \end{eqnarray}

◆ ir_com_covariance()

Real ir_com_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

TODO: COM covariance with all other risk factors

◆ ir_crstate_covariance()

Real ir_crstate_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

IR_CrState Covariance

◆ fx_crstate_covariance()

Real fx_crstate_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

FX_CrState Covariance

◆ crstate_crstate_covariance()

Real crstate_crstate_covariance ( const CrossAssetModel & model,
const Size i,
const Size j,
const Time t0,
const Time dt )

CrState_CrState Covariance

◆ integral_helper()

template<class E>
Real integral_helper ( const CrossAssetModel & x,
const E & e,
const Real t )

generic integrand

◆ integral()

template<typename E>
Real integral ( const CrossAssetModel & model,
const E & e,
const Real a,
const Real b )

generic integral calculation

◆ P() [1/4]

template<class E1, class E2>
const P2_< E1, E2 > P ( const E1 & e1,
const E2 & e2 )

creator function for product expression, 2 factors

◆ P() [2/4]

template<class E1, class E2, class E3>
const P3_< E1, E2, E3 > P ( const E1 & e1,
const E2 & e2,
const E3 & e3 )

creator function for product expression, 3 factors

◆ P() [3/4]

template<class E1, class E2, class E3, class E4>
const P4_< E1, E2, E3, E4 > P ( const E1 & e1,
const E2 & e2,
const E3 & e3,
const E4 & e4 )

creator function for product expression, 4 factors

◆ P() [4/4]

template<class E1, class E2, class E3, class E4, class E5>
const P5_< E1, E2, E3, E4, E5 > P ( const E1 & e1,
const E2 & e2,
const E3 & e3,
const E4 & e4,
const E5 & e5 )

creator function for product expression, 5 factors

◆ LC() [1/4]

template<class E1>
const LC1_< E1 > LC ( QuantLib::Real c,
QuantLib::Real c1,
const E1 & e1 )

creator function for linear combination, 1 factor

◆ LC() [2/4]

template<class E1, class E2>
const LC2_< E1, E2 > LC ( QuantLib::Real c,
QuantLib::Real c1,
const E1 & e1,
QuantLib::Real c2,
const E2 & e2 )

creator function for linear combination, 2 factors

◆ LC() [3/4]

template<class E1, class E2, class E3>
const LC3_< E1, E2, E3 > LC ( QuantLib::Real c,
QuantLib::Real c1,
const E1 & e1,
QuantLib::Real c2,
const E2 & e2,
QuantLib::Real c3,
const E3 & e3 )

creator function for linear combination, 3 factors

◆ LC() [4/4]

template<class E1, class E2, class E3, class E4>
const LC4_< E1, E2, E3, E4 > LC ( QuantLib::Real c,
QuantLib::Real c1,
const E1 & e1,
QuantLib::Real c2,
const E2 & e2,
QuantLib::Real c3,
const E3 & e3,
QuantLib::Real c4,
const E4 & e4 )

creator function for linear combination, 4 factors