# Understanding correlation in the context of a time series, simulation and brownian motion

I have the doubt of calulating and meaning of correlation. I know it is from my incapacity to grasp a concept, specially regarding time series but would appreciate any comments on it.

I think I understand covariance. If, with two random variables $$X,Y$$ I have, from each one a sample (i.e. vector of instances from a single entity or r.v.), I can calculate and estimated covariance given by the formula of the sum we all know. It is an estimator of the expected value $$E((X-\mu_x)(Y-\mu_y)$$. From the formula of the covariance I already know the two samples need to be in the order they were obeserved (each pair $$(x_i,y_i)$$ is interpreted as a single individual observation).

My problem is when we go to time series and stochastic processes. My understanding is that for each time $$t$$, we have a random variable $$X_t$$. First of all, but that would be for another whole question, in the context of time series, I just have one observation for each random variable, but anyway, assuming we can know the expected values at each time, we can calculate a function of covariances, meaning that $$cov(X_t,X_s)$$ is a function of times $$t$$ and $$s$$, but I do not quite get when we talk about the correlation between two processes. I will go to the point: In brownian motion, for example, we have that a standard univariate brownian motion $$B_t$$ has a covariance function of $$min(t,s)$$. That means that if I have a simulation of d trajectories and n steps, I am sampling each individual random variable d times, and will have a covariance matrix of nxn, because again, at each time I have a r.v. But if I want to simulate correlated brownian motions, then I say $$W_1=B_1$$ and $$W_2=\rho B_1+\sqrt{1-\rho^2}B_2$$ and I say these processes have correlation $$\rho$$. That means that if I make a simulation of these vectors, I would search the correlation between them as a pair of samples of random variables, but they aren't.

Hi: I think you mostly understand it but are only getting confused because you are not differentiating between autocorrelation and correlation.

Correlation is calculated on the values of TWO different random variables like in the example you gave where you have two different brownian motions, A and B. In this case, the correlation can be calculated over time but the values used are the value of brownoian motion A at time $$t$$ and the value of brownian motion B at time $$t$$. So, the times used are the same but there are TWO different random variables.

Notice that, in the case of correlation, there is also the case where one might want to calculate the correlation between say heights of teenage males and weights of teenage males. In this case, there is no concept of time.

Autocorrelation is the same notion but it's always calculated on the values of ONE random variable at different times. That's where the min(t,s) comes from because you are calculating the correlation between the SAME brownian motion at time t and at time s. Autocorrelation is only used when there is the notion of time because one needs "new" instances the one RV in order to calculate it and the way those instances arise is because ONE random variable takes on values at different times.

#================================================================== 11-27-2023

ADDENDUM REGARDING CONFUSION BETWEEN VIEWING TWO RANDOM VARIABLES ASSOCIATED WITH A STOCHASTIC PROCESSES AS TWO VECTORS.

In textbooks, they tend to stress that one should look at a stochastic process as a vector, which is fine. But, when calculating the correlation, it is calculated by summing the demeaned scalar valued product at each time, $$t_{i}$$ and then dividing by the square root of the product of the standard deviations.

At each time $$t$$, each brownian motion is a scalar so, if $$t$$ goes from say $$t_{1}, t_{2}, t_{3}, \ldots t_{n}$$, then there are $$n$$ observations of each RV. But, when you calculate the estimate of the correlation, you don't really consider the vector. You calculate the correlation over the each of the individual observations ( the pairs, $$X_{t_{i}}, Y_{t_{i}}$$). So, suppose you had two brownian motions, $$X_t$$ and $$Y_t$$, then you would calculate the correlation estimate using:

$$corr(X,Y) = \frac{\sum_{i=1}^{n} (X_{t_{i}} - \bar{X}) (Y_{t_{i}} - \bar{Y})} {\sqrt{\hat{\sigma}_x \hat{\sigma}_y}}$$

So, the resulting correlation estimate is a scalar, even though there are $$n$$ observations of each random variable. I hope that clears things up. You are correct that it is emphasized that the stochastic process can be viewed as a vector but correlation and autocorrelation are scalar values.

• Thanks for your response. Even though, you mention that the two brownian motions are two different random variables. That is what I point in my question: as I understand, they are not two random variables, but a vector of observation of n diferent random variables (one different at each time). When I take correlation between two vectors I can not see what is the thing I am really estimating. Nov 26, 2023 at 19:15
• @Curious student: I added something to the bottom of my answer. I hope it helps. Nov 27, 2023 at 8:30
• Just one more thing: Note that one would probably not calculate the correlation between two brownian motions because neither process can be considered stationary but I realize that you were just providing an example to explain your question. Generally, when dealing with time series, correlation should only be calculated between two stationary processes. It doesn't have much meaning otherwise. Nov 27, 2023 at 8:36