Skip to main content
1 of 2

Modelling interest rate

Hi I want to model the G2++ short rate model in Matlab, which is given by $ r(t) = x(t) + y(t) + \varphi(t),r(0) = r_0$ with $\\\\$

$dx(t) = -a x(t) dt + \sigma dW_1(t), x(0) = 0 \\ dy(t) = -by(t) dt + \eta dW_2(t), y(0) = 0 $
$\\\\$

Integrating leads to $\\\\$

$r(t) = x(s) e^{-a(t-s)} + y(s) e^{-b(t-s)} + \sigma \int_s^t e^{-a(t-u)} dW_1(u) + \eta \int_s^t e^{-b(t-u)} dW_2(u) + \varphi(t)$ $\\\\$

Furthermore we have given that $r(t)$ is normally distributed and we know its conditional mean and variance. Hence we also know

$E[x(t) \vert F_s]$ and $Var[x(t) \vert F_s]$ and respectively for $y(t)$.

I want to implement this in Matlab. I want to model paths for x(t) and y(t)

Questions:

  1. Is modelling the dynamics for $dx(t)$ and $dy(t)$ the same as if I model $x(t)$ and $y(t)$ given $E[x(t) \vert F_s]$ and $Var[x(t) \vert F_s]$ ?

  2. How to model x(t) with the process $x(t) = x(s) e^{-a(t-s)} + \sigma \int_s^t e^{-a(t-u)} dW_1(u)$ given its conditional expectation and variance.