Solution (source code)

= Solution

Use a <risk-neutral measure> $Q$, and let $P_{s,t}$ be the price at time $s$ of a <zero-coupon bond> paying one at its maturity $t$. The information available at $s$ is the <filtration> $\mathcal F_s$. For positive differentiable bond prices, the <instantaneous forward rate> is
$$
f(s,t)=-\partial_t\log P_{s,t},\qquad P_{s,t}=\exp\left(-\int_s^t f(s,u)\,du\right),
$$
with $P_{t,t}=1$. The <short rate> is $R_s=f(s,s)$. The <continuous-time bank account> $B_s=\exp(\int_0^sR_u\,du)$ is the discounting <numéraire>.

If $P_{s,t}/B_s$ is a true <martingale> for each fixed maturity, then its terminal value is $B_t^{-1}$ and
$$
\frac{P_{s,t}}{B_s}=\mathbb E_Q[B_t^{-1}\mid\mathcal F_s].
$$
Multiplication by the $\mathcal F_s$-measurable $B_s$ gives
$$
\boxed{P_{s,t}=\mathbb E_Q\left[e^{-\int_s^tR_u\,du}\mid\mathcal F_s\right].}
$$
Conversely this conditional-expectation formula makes the discounted bond a <martingale> by the <tower property of conditional expectation>. The equivalence uses integrability and true <martingales>, rather than merely local <martingales>.

Forward-rate modelling specifies the stochastic evolution of $f(s,t)$ as $s$ varies at fixed maturity. For example, with one Brownian driver, write $df(s,t)=\alpha(s,t)ds+\beta(s,t)dW_s^Q$. Differentiation of the integral representation and <Itô formula> give the bond's relative volatility $-\int_s^t\beta(s,u)du$ and drift $R_s-\int_s^t\alpha(s,u)du+\frac12(\int_s^t\beta(s,u)du)^2$. The discounted-bond condition therefore imposes
$$
\int_s^t\alpha(s,u)du=\frac12\left(\int_s^t\beta(s,u)du\right)^2,
$$
or, after differentiation in maturity, $\alpha(s,t)=\beta(s,t)\int_s^t\beta(s,u)du$. This illustrates how the no-arbitrage condition constrains forward-rate drift.

For the <Gaussian short-rate model with constant coefficients>, let $dR_s=\theta ds+\sigma dW_s^Q$ and fix $\Delta=t-s$. Future Brownian increments are independent of $\mathcal F_s$, giving
$$
\int_s^tR_u\,du=\Delta R_s+\frac\theta2\Delta^2+\sigma\int_s^t(t-v)\,dW_v^Q.
$$
The last stochastic integral is Gaussian with mean zero and variance $\Delta^3/3$, by the <Itô isometry>. Its <Gaussian moment-generating function> therefore gives
$$
\boxed{P_{s,t}=\exp\left[-\Delta R_s-\frac\theta2\Delta^2+\frac{\sigma^2}{6}\Delta^3\right],\quad b_{s,t}=\Delta,\quad a_{s,t}=-\frac\theta2\Delta^2+\frac{\sigma^2}{6}\Delta^3.}
$$
When $\sigma\neq0$ and the initial rate is deterministic, the Brownian and short-rate filtrations coincide because $W_s^Q=(R_s-R_0-\theta s)/\sigma$. If $\sigma=0$, the same bond formula holds deterministically, while the asserted filtration equivalence is unnecessary.

For a deterministic drift function $\theta_v$, the same calculation gives
$$
P_{s,t}=\exp\left[-(t-s)R_s-\int_s^t(t-v)\theta_v\,dv+\frac{\sigma^2}{6}(t-s)^3\right].
$$
Let the observed initial curve be $P^{\rm obs}_{0,t}>0$, normalized by $P^{\rm obs}_{0,0}=1$, and define $f_0(t)=-\frac d{dt}\log P^{\rm obs}_{0,t}$. For a differentiable initial forward curve choose
$$
\boxed{R_0=f_0(0),\qquad\theta_t=f_0'(t)+\sigma^2t.}
$$
Indeed the model's initial forward rate is $R_0+\int_0^t\theta_vdv-\sigma^2t^2/2=f_0(t)$, so integrating it gives exactly the observed bond curve. This is <forward-curve calibration of a shifted Brownian short rate>, with $R_t=f_0(t)+\sigma^2t^2/2+\sigma W_t^Q$. Every finite collection of positive bond quotes can first be fitted by a smooth positive curve; an arbitrary entire curve requires the stated smoothness or an appropriate weaker integral interpretation. The freedom is in the deterministic drift, and the initial short rate must match the initial forward rate.