Vasicek model (source code)

= Vasicek model
{c}
{title2=$dr_t=a(b-r_t)dt+\eta dW_t$}
{wiki}

A Gaussian <short rate> model with <Ornstein-Uhlenbeck process> dynamics under the chosen pricing measure. For $a>0$, its unit <zero-coupon bond> value is $P(t,T)=A(\tau)e^{-B(\tau)r_t}$, where $\tau=T-t$, $B(\tau)=(1-e^{-a\tau})/a$ and
$$
\log A(\tau)=\left(b-\frac{\eta^2}{2a^2}\right)(B(\tau)-\tau)-\frac{\eta^2}{4a}B(\tau)^2.
$$
Solve the linear <stochastic differential equation>, integrate over future time, and use the <exponential moment> of the resulting Gaussian integral to obtain this price. Its Gaussian law permits negative <short rates>.