This note covers stochastic processes, and their core concepts:

  • Mean
  • Covariance functions
  • Stationary
  • Autocorrelation

About time series and stochastic processes

A stochastic process is a sequence of random variables , used to model time series data.

Its full probabilistic structure is defined by the joint distributions of all finite subsets of .

In practice, we focus on means, variances, and covariances (first and second moments) rather than the full distributions.

Means, variances, and covariances

For a stochastic process , its key functions are:

  • Mean function The expected value at time .
  • Autocovariance function Measuring dependence between and .
  • Autocorrelation function Unitless measure of linear dependence.

Properties

  • (symmetry)

A key result for covariance of linear combinations is:

Some stochastic processes

Suppose that

  • are independent, identically distributed (i.i.d.)

Random walk

PropertyExpression
Mean
Variance
Autocovariance
Autocorrelation

Notice the variance of the process increases with time.

Random walk also has the inductive form:

With “initial state” .

Intuition

If the is interpreted as the size of “step” taken at time , then can be interpreted as the position of the “random walker” at time .

Also notice the following autororrelation values

![foo|500](assets/Pasted image 20250428140032.png)

Values of at neighboring time points are more and more strongly and positively correlated as time goes by.

On the other hand, the values of at distant time points are less and less correlated.

Code example:

import random
 
random_walk: list[float] = [0.0]
for _ in range(100):
    random_walk.append(random_walk[-1] + random.uniform(-1,1))
 
import matplotlib.pyplot as plt
plt.plot(random_walk)
plt.show()

Moving average

PropertyExpression
Mean
Variance
Autocovariance
Autocorrelation

Notice that values of at units of time apart have the same correlation no matter where they occur (for any ).

This leads us to an important concept in time series which is stationarity, which will be covered in Stationarity.