I have two geometric Brownian motions (GBMs) driven by the same underlying Brownin motion, namely \begin{align*} S_t^1 = S_0^1\exp\left(\left(\mu_1 - \frac{\sigma_1^2}{2}\right)t + \sigma_1 W_t\right), \\ S_t^2 = S_0^2\exp\left(\left(\mu_2 - \frac{\sigma_2^2}{2}\right)t + \sigma_2 W_t\right). \end{align*}
The theoretical correlation between these two processes at time $t$ is $$ Corr(S_t^1, S_t^2) = \frac{\exp(\sigma_1 \sigma_2 t) - 1}{\sqrt{(\exp(\sigma_1^2t) - 1)(\exp(\sigma_2^2t) - 1)}}. $$
For example, letting $\sigma_1 = 0.15$ and $\sigma_2 = 0.1$, a plot of $Corr(S_t^1, S_t^2)$ for $0 < t \leq 10$ looks like
A simulation of the processes $S_t^1$ and $S_t^2$ over $0 \leq t \leq 10$ using the same $\sigma_1$ and $\sigma_2$ and letting $\mu_1 = 0.02$, $\mu_2 = 0.1$, $S_0^1 = 30$ and $S_0^2 = 40$ looks like
However, when I use the MATLAB function corr(S_1, S_2)
I get that the correlation from this particular time series is corr(S_1, S_2)
= 0.6428.
So there are these interpretations of correlation: the correlation of two random variables at a given time, given by $Corr(S_t^1, S_t^2)$, and the correlation of two time series, computed by corr(S_1, S_2)
. I'm trying to reconcile the difference between the two, and I'd appreciate a solid explanation!