Skip to content
All library documents

Modeling Bounded Correlations with a Transformed Ornstein–Uhlenbeck Process

Article Quant Q&A · Author: Lucas Morin

Summary

The document asks how to model feature–return correlations that fluctuate around zero over time while remaining within the valid correlation range. One proposed construction starts with an unbounded diffusion, such as a mean-reverting Ornstein–Uhlenbeck process, then maps it through a cumulative distribution function into the interval from −1 to 1. With a standard normal mapping, the transformed process is expressed through the Gaussian error function. Adjusting the latent process’s volatility can shape how concentrated the correlation is near zero or near the bounds.

A second answer gives a separate approach for simulating correlated Gaussian variables: generate independent normal shocks, transform them using a matrix square root of a chosen covariance matrix, then standardize to obtain correlations. These are modeling constructions, not validated forecasts of observed financial correlations. The discussion does not provide data fitting, model comparison, or guidance for estimating parameters from a particular competition dataset; the appropriate shock and dynamics remain application-dependent.

Key ideas

  • An unbounded diffusion can be mapped through a cumulative distribution function to keep a modeled correlation within its valid bounds.
  • A mean-reverting Ornstein–Uhlenbeck process centered at zero is suggested for a latent correlation driver.
  • The latent process’s volatility affects whether transformed correlations cluster near zero or near the endpoints.
  • Correlated Gaussian variables can be simulated by applying a matrix square root of a covariance matrix to independent normal shocks.
  • The proposed constructions do not establish which dynamics best fit any particular observed correlation series.

Tags

Full text
# Stochastic process for modelling correlation?


# Stochastic process for modelling correlation?












This question relates to Financial Machine Learning, and more specifically to competitions like Numerai.

In this competition we have a dataset X and a target y (return over a given horizon). The dataset contains some features (say feature_0 to feature_n) and time. Different stocks are available each time.

One important metric is the correlation bewteen features and the target. Correlation can be either spearman or pearson. We can observe past correlations. I was wondering if there is a standard way to model this kind of correlation over time.

The correlations seems very random, changing signs quite often, oscillating around 0. I was thinking about some mean reverting process, centered at some value near 0. I was thinking about an OU process with a small drift and a high reversion coefficient.

However, as they are correlations, they would be capped by -1 / +1. I don't know how to deal with this. As the correlation are oscillating around 0, I am tempted to ignore this constraint. But it might be better to add some logistic function somewhere.

Any idea of a standard approach to model correlation over time ?

## Answer by Daneel Olivaw (score 4)

https://quant.stackexchange.com/a/77556

One idea could be the following.

Let $\eta:\mathbb{R}_+\times\Omega\rightarrow\mathbb{R}$ be some diffusion process taking values over the whole real line: $$\eta_t=\eta_0+\int_0^t\alpha_t\text{d}t+\int_0^t\beta_t\text{d}W_t$$ for some adapted process $\alpha,\beta$ and where $W$ is a Brownian Motion. Let $F:\mathbb{R}\rightarrow[0,1]$ be the cumulative distribution function (CDF) for some random variable taking values in $\mathbb{R}$ and $f$ its probability density functions (PDF). Define the process $\varrho:\mathbb{R}_+\times\Omega\rightarrow\mathbb{R}$ as follows: $$\varrho_t=2F(\eta_t)-1$$ Then $\varrho_t\in[-1,1]$ and the process $\varrho$ satisfies the SDE: \begin{align} \text{d}\varrho_t &=2f(\eta_t)\text{d}\eta_t+f^\prime(\eta_t)\text{d}[\eta,\eta]_t\\ &=\left(2f(\eta_t)\alpha_t+f^\prime(\eta_t)\beta^2_t\right)\text{d}t+2f(\eta_t)\beta_t\text{d}W_t \end{align}

Your intuiton is right, I would choose $\eta$ to be an OU process starting at zero ($\eta_0=0$) and also centred at 0 such that: $$\text{d}\eta_t=-\alpha\eta_t\text{d}t+\beta\text{d}W_t$$ Then take $F,f$ to be the CDF, PDF resp. for the standard normal distribution that is $F\equiv\Phi$ and $f\equiv\varphi$. Note that in this case we have: \begin{align} \varrho_t=\text{erf}\left(\frac{\eta_t}{\sqrt{2}}\right) \end{align} where $\text{erf}$ is the Gaussian error function. Recall that $\varphi^\prime(x)=-x\varphi(x)$ hence: \begin{align} \text{d}\varrho_t &=2\varphi(\eta_t)\left(-\left(\alpha+\frac{\beta^2}{2}\right)\eta_t\text{d}t+\beta\text{d}W_t\right) \end{align} Let us define the mean and standard deviation from $\eta$ as: $$\mu(t)=0,\qquad\sigma(t)=\frac{\beta^2}{2\alpha}(1-e^{-2\alpha t})$$ Then the distribution of $\varrho_t$ for given $t$ is a "stretched" uniform: $$\mathbb{P}(\varrho_t\leq p) =\Phi\left(\frac{1}{\sigma(t)}\Phi^{-1}\left(\frac{p+1}{2}\right)\right)$$ In particular:

- $\mathbb{P}(\varrho_t\leq0)=0.5$.

- If $\sigma(t)=1$ then $\varrho_t$ is uniformly distributed.

Below I have plotted the distribution of $\varrho_t$ for different values of $\sigma(t)$ to get a flavour of what you can achieve. By increasing the vol, you progressively move from a degenerate distribution with all mass at $\varrho_t=0$ to a binary distribution where as $\sigma(t)\rightarrow\infty$ you get $\varrho_t=-1$ or $1$. The first and second moments are: \begin{align} &\mathbb{E}(\varrho_t)=0\\ &\mathbb{E}(\varrho_t^2)=\frac{4}{\pi}\text{arctan}\sqrt{1+2\sigma^2(t)}-1 \end{align}

Because $\sigma(t)$ changes with time, you might want to replace $\beta$ by a deterministic function $\beta(t)$ in the SDE for $\eta$ and use that to control the behaviour of $\sigma(t)$ i.e. ensure it remains close to some target value $\sigma_0$.

## Answer by phdstudent (score 3)

https://quant.stackexchange.com/a/76012

We probably need more information about the shocks.

But for example if your shocks are gaussian you can just define a joint variance-covariance matrix. You should apply it to the covariance matrix and from that compute the correlation matrix. Here's an example correlating 3 random normal variables.

Let:

$$ \bf Y \sim \mathcal N(0, \Sigma) $$

where $\textbf{Y} = (Y_1,\dots,Y_n)$ is the vector of normal random variables, and $\Sigma$ the given covariance matrix.

The process is:

- Simulate a vector of uncorrelated Gaussian random variables, $\bf Z $

- Then find a square root of $\Sigma$, i.e. a matrix $\bf C$ such that $\bf C \bf C^\intercal = \Sigma$.

Then the target vector is given by $$ \bf Y = \bf C \bf Z. $$

Here is a dummy matlab code:

```
N = 500000
u_1 = normrnd(zeros(N,1),1);
u_2 = normrnd(zeros(N,1),1);
u_3 = normrnd(zeros(N,1),1);
u_4 = normrnd(zeros(N,1),1);

rv = [u_1 '; u_2'; u_3'; u_4'];

VarCov = [Some positive semi-definite matrix here 4x4];

ch = chol(VarCov);
result = ch * rv;
```

Then just divide each entry of the result matrix by the product of the standard deviations to get a correlation matrix.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.