Simulate Zero Coupon Bond Using Chen's Model
Simulate Zero Coupon Bond Using Chen's Model
chenmodel[θ_, ζ_, β_, η_, {r0_, α0_, σ0_}] := ItoProcess[{
ⅆr[t] == (θ - α[t])ⅆt + Sqrt[r[t]]σ[t]ⅆw[t],
ⅆα[t] == (ζ - α[t])ⅆt + Sqrt[α[t]]σ[t]ⅆw[t],
ⅆσ[t] == (β - σ[t])ⅆt + Sqrt[σ[t]]η ⅆw[t]
}, r[t], {{r, α, σ}, {r0, α0, σ0}}, t, wWienerProcess[]
]Visualize some trajectories using the stochastic Runge–Kutta method, correcting for negative interest rates that result from the use of the approximation:
ListLinePlot[RandomFunction[chenmodel[1, 2, 1.2, 1, {1, 1, 1}], {0, 1, 0.01}, 6, Method -> {"StochasticRungeKutta", "ProjectionFunction" -> Function[{t, xvec}, Abs[xvec]]}]]Evaluate zero‐coupon bond maturing at time 1 using the Monte Carlo method. The present value of the bond is given by the mean of the process
:
zcb[θ_, ζ_, β_, η_, {r0_, α0_, σ0_}] = ItoProcess[ⅆx[t] == r[t]ⅆt, Exp[-x[t]], {x, 0}, t, rchenmodel[θ, ζ, β, η, {r0, α0, σ0}]];td = RandomFunction[zcb[1, 2, 1.2, 1, {1, 1, 1}], {0, 1, 0.02}, 250, Method -> {"StochasticRungeKutta", "ProjectionFunction" -> Function[{t, xvec}, Abs[xvec]]}];
Plot[Mean[td[t]]//Evaluate, {t, 0, 1}, AxesOrigin -> {0, 0}, PlotLabel -> Row[{"P(0,1)≃", Mean[td[1]]}]]