Vasicek short rate with κ > 0 and a constant market price of risk λ. Under the Girsanov measure Q_λ = μ.withDensity(exp(−λB_T − λ²T/2)), the terminal short rate r_T = r₀e^{−κT} + θ(1 − e^{−κT}) + σ∫₀ᵀ e^{−κ(T−s)} dB_s has the Gaussian law N(mean_θ − λσ·B(T), σ²(1 − e^{−2κT})/(2κ)), with B(T) = (1 − e^{−κT})/κ. This is the law of the Vasicek short rate at the risk-adjusted level θ − λσ/κ. Q_λ is the measure the library builds: a probability measure (isProbabilityMeasure_withDensity_girsanov) under which, with a filtration, B_t + λt has, on [0, T], the increments of a Brownian motion (Btheta_isQBrownianMotion). The proof uses the Cameron–Martin shift of Wiener integrals under Q_λ (mean −λ∫f, variance unchanged); no joint law of (B_T, ∫e^{−κ(T−s)}dB_s) is needed. The short rate and its time integral are carried in their Wiener representations (integrals of deterministic kernels against the pre-Brownian driver B under μ); that they solve the short-rate SDE, and the time-order swap behind the integrated rate, are cited, not proved.
∀ (r₀ θ κ σ lam T : ℝ), κ ≠ 0 → vasicekSDEMean r₀ θ κ T = vasicekSDEMean r₀ (θ - lam * σ / κ) κ T + lam * σ * vasicekBondB κ T
Real-world vs. risk-neutral Vasicek mean. An algebraic identity of the closed form vasicekSDEMean, for κ ≠ 0: replacing the long-run level θ by the risk-neutral level θ − lamσ/κ changes the terminal mean by −lamσ·(1 − e^{−κT})/κ.