# how to calculate pdf and cdf for an Ornstein-Uhlenbeck process

I have the

Task. For Ornstein-Uhlenbeck process generate a path and plot a) cumulative distribution (cdf), b) density function (pdf), c) calculate the 95%-quantile.

My solution. From the literature we known the conditional law for OU process $$dX_t = (\theta_1 - \theta_2 X_t)dt + \theta_3 dW_t, \quad X_0 = x_0$$ is the Gaussian. For any $$t \geq 0$$, the Ornstein-Uhlenbeck process has a Gaussian transition (or conditional) density $$p_\theta(t, X_t|X_0 = x_0),$$ with mean and variance respectively $$m(t, x) = \mathbb{E}_{\theta}(X_t|X_0 = x_0) = \frac{\theta_1} {\theta_2} + \left(x_0 - \frac{\theta_1} {\theta_2} \right) e^{-\theta_2 t} %(1.41)$$ and $$v(t, x) = Var_{\theta}(X_t|X_0 = x_0) = \frac{\theta_3^2}{2 \theta_2} (1-e^{-2\theta_2 t}) .$$ I generated random value $$X_t \sim N(m(t,x), \sqrt{v(t,x)})$$, then plot pdf and cdf and calculate the 95%-quatile.

Question. I need to check if my decision is correct.