# How to generate time series with correlation and autocorrelation?

Is it possible to generate multiple (e.g. 3) time series, each with predefined volatility, and together with an predefined correlation matrix , plus, one of the time series has a predefined autocorrelation ? If so, how to do that?

• Maybe you are seeking something along the lines of this post? Commented Jan 10, 2017 at 7:39

## 1 Answer

Have a look here. General idea is to generate normal random variables with give covariance matrix.

If Z is a vector of uncorrelated Gaussian random variables, and C is a square root of the given covariance matrix, then target variable will be mean+CZ.

To obtain C You may use Cholesky decomposition.

If You may obtain Gaussian variable with a given covariance matrix, then You may convert it to differently distributed variable using inverse CDF method.

Important to notice, that CDF of any target vector is uniformly distributed, than You just map your CDF to a desired. Finally You have random variable from any distribution wich has given covariance matrix.