# Ornstein-Uhlenbeck process with random long run mean

I am considering an OU process of the form $$dx_t = \theta(\mu-x_t)dt + \sigma dW_t$$ where $$\kappa, \sigma>0$$ and $$W_t$$ is a Brownian motion. I know that $$x_t$$ has expectation given by: $$\mathbb{E}[x_t]=x_0 e^{-\theta t}+𝜇(1−e^{-\theta t})\ .$$ I read here what happens when $$\mu$$ is a function of time but I was wondering what happens when $$\mu$$ is a stochastic process. For instance, what happens when $$\mu$$ satisfies the SDE: $$d\mu_t = \gamma dt + \beta dB_t\ ,$$ where $$B_t$$ is a Brownian motion?

• Assuming $B$ is independent of $W$, we can just condition on $\mu_t$, $$\mathbb{E}\left[x_t \left | \mu_t \right. \right] = x_0 e^{-\theta t} + \mu_t \left(1 - e^{-\theta t}\right).$$ Then taking the expectation again, we get by the tower property that $$\mathbb{E}\left[x_t\right] = x_0 e^{-\theta t} + \mathbb{E}\left[\mu_t\right]\left(1- e^{-\theta t}\right) = x_0 e^{-\theta t} + \gamma t\left(1- e^{-\theta t}\right).$$ Commented Apr 5, 2022 at 10:05
• Thank you @Shiva
– Zwei
Commented Apr 5, 2022 at 10:45
• @Shiva It seems a little surprising that just knowing the value of $\mu_t$ is enough to compute $\mathbb{E}[x_t]$. Shouldn't the whole path $(\mu_s)_{s \le t}$ play a role? Commented Apr 5, 2022 at 14:12
• @user6247850 I guess this is the case because $\mu$ is a martingale
– Zwei
Commented Apr 6, 2022 at 8:11
• $\mu$ isn't a martingale, though - it has a drift. I think we can still get a fairly nice expression for $\mathbb{E}[x_t]$, but it's not the one in @Shiva's comment. Commented Apr 6, 2022 at 13:58

Using the standard strategy for explicitly solving the SDE of an OU process we can solve $$dx_t = \theta \left(\mu_t - x_t\right)dt + \sigma dW_t \quad\quad \mu_t = \gamma t + \beta B_t,$$ with $$W$$ and $$B$$ independent Brownian motions. As user6247850 suggested, this then gives a nice expression for $$\mathbb{E}\left[x_t\right]$$. We have $$d\left(e^{\theta t} x_t\right) = \theta e^{\theta t}x_t dt + e^{\theta t}\left(\theta \left(\mu_t - x_t\right)dt + \sigma dW_t\right) = e^{\theta t} \left(\theta \mu_t dt + \sigma dW_t\right).$$ Then this means that we get $$e^{\theta t} x_t = x_0 + \theta\int_0^te^{\theta s} \left(\gamma s + \beta B_s\right) ds + \int_0^t e^{\theta s}dW_s.$$ Bring rearranging and using integration by parts, $$x_t = e^{-\theta t}\left(x_0 + \frac{\gamma}{\theta}\right) + \gamma t - \frac{\gamma}{\theta} + \beta B_t - \beta \int_0^t e^{-\theta\left(t-s\right)}dB_s + \sigma \int_0^t e^{-\theta(t-s)}dW_s.$$ The last three terms being a martingale starting at zero, the expectation is given by $$\mathbb{E}\left[x_t\right] = e^{-\theta t}\left(x_0 + \frac{\gamma}{\theta}\right) + \gamma t - \frac{\gamma}{\theta}.$$