# Sum of normally distributed random variables

In probability theory, calculation of the sum of normally distributed random variables is an instance of the arithmetic of random variables, which can be quite complex based on the probability distributions of the random variables involved and their relationships.

## Independent random variables

If X and Y are independent random variables that are normally distributed (not necessarily jointly so), then their sum is also normally distributed. i.e., if

$X \sim N(\mu_X, \sigma_X^2)$
$Y \sim N(\mu_Y, \sigma_Y^2)$
$Z=X+Y$

and X and Y are independent, then

$Z \sim N(\mu_X + \mu_Y, \sigma_X^2 + \sigma_Y^2).$

This means that the sum of two independent normally distributed random variables is normal, with its mean being the sum of the two means, and its variance being the sum of the two variances (i.e., the square of the standard deviation is the sum of the squares of the standard deviations).

Note that the result that the sum is normally distributed requires the assumption of independence, not just uncorrelatedness; two separately (not jointly) normally distributed random variables can be uncorrelated without being independent, in which case their sum can be non-normally distributed (see Normally distributed and uncorrelated does not imply independent#A symmetric example). The result about the mean holds in all cases, while the result for the variance requires uncorrelatedness, but not independence.

### Proofs

#### Proof using characteristic functions

[citation needed]

The characteristic function

$\varphi_{X+Y}(t) = \operatorname{E}\left(e^{it(X+Y)}\right)$

of the sum of two independent random variables X and Y is just the product of the two separate characteristic functions:

$\varphi_X (t) = \operatorname{E}\left(e^{itX}\right), \qquad \varphi_Y(t) = \operatorname{E}\left(e^{itY}\right)$

of X and Y.

The characteristic function of the normal distribution with expected value μ and variance σ2 is

$\varphi_X(t) = \exp\left(it\mu - {\sigma^2 t^2 \over 2}\right).$

So

$\varphi_{X+Y}(t)=\varphi_X(t) \varphi_Y(t) =\exp\left(it\mu_X - {\sigma_X^2 t^2 \over 2}\right) \exp\left(it\mu_Y - {\sigma_Y^2 t^2 \over 2}\right) = \exp \left( it (\mu_X +\mu_Y) - {(\sigma_X^2 + \sigma_Y^2) t^2 \over 2}\right).$

This is the characteristic function of the normal distribution with expected value $\mu_X + \mu_Y$ and variance $\sigma_X^2+\sigma_Y^2$

Finally, recall that no two distinct distributions can both have the same characteristic function, so the distribution of X+Y must be just this normal distribution.

#### Proof using convolutions

[citation needed]

For random variables X and Y, the distribution fZ of Z = X+Y equals the convolution of fX and fY:

$f_Z(z) = \int_{-\infty}^\infty f_Y(z-x) f_X(x) dx$

Given that fX and fY are normal densities,

$f_X(x) = \frac{1}{\sqrt{2\pi}\sigma_X} e^{-{(x-\mu_X)^2 \over 2\sigma_X^2}}$
$f_Y(y) = \frac{1}{\sqrt{2\pi}\sigma_Y} e^{-{(y-\mu_Y)^2 \over 2\sigma_Y^2}}$

Substituting into the convolution:

$\begin{align} f_Z(z) &= \int_{-\infty}^\infty \frac{1}{\sqrt{2\pi}\sigma_Y} e^{-{(z-x-\mu_Y)^2 \over 2\sigma_Y^2}} \frac{1}{\sqrt{2\pi}\sigma_X} e^{-{(x-\mu_X)^2 \over 2\sigma_X^2}} dx \\ &= \int_{-\infty}^\infty \frac{1}{\sqrt{2\pi}\sqrt{\sigma_X^2+\sigma_Y^2}} \exp \left[ - { (z-(\mu_X+\mu_Y))^2 \over 2(\sigma_X^2+\sigma_Y^2) } \right] \frac{1}{\sqrt{2\pi}\frac{\sigma_X\sigma_Y}{\sqrt{\sigma_X^2+\sigma_Y^2}}} \exp \left[ - \frac{\left(x-\frac{\sigma_X^2(z-\mu_Y)+\sigma_Y^2\mu_X}{\sigma_X^2+\sigma_Y^2}\right)^2}{2\left(\frac{\sigma_X\sigma_Y}{\sqrt{\sigma_X^2+\sigma_Y^2}}\right)^2} \right] dx \\ &= \frac{1}{\sqrt{2\pi(\sigma_X^2+\sigma_Y^2)}} \exp \left[ - { (z-(\mu_X+\mu_Y))^2 \over 2(\sigma_X^2+\sigma_Y^2) } \right] \int_{-\infty}^\infty \frac{1}{\sqrt{2\pi}\frac{\sigma_X\sigma_Y}{\sqrt{\sigma_X^2+\sigma_Y^2}}} \exp \left[ - \frac{\left(x-\frac{\sigma_X^2(z-\mu_Y)+\sigma_Y^2\mu_X}{\sigma_X^2+\sigma_Y^2}\right)^2}{2\left(\frac{\sigma_X\sigma_Y}{\sqrt{\sigma_X^2+\sigma_Y^2}}\right)^2} \right] dx \end{align}$

The expression in the integral is a normal density distribution on x, and so the integral evaluates to 1. The desired result follows:

$f_Z(z) = \frac{1}{\sqrt{2\pi(\sigma_X^2+\sigma_Y^2)}} \exp \left[ - { (z-(\mu_X+\mu_Y))^2 \over 2(\sigma_X^2+\sigma_Y^2) } \right]$

#### Geometric proof

[citation needed]

First consider the normalized case when X, Y ~ N(0, 1), so that their PDFs are

$f(x) = \sqrt{1/2\pi \,} e^{-x^2/2}$

and

$g(y) = \sqrt{1/2\pi\,} e^{-y^2/2}.$

Let Z = X+Y. Then the CDF for Z will be

$z \mapsto \int_{x+y \leq z} f(x)g(y) \, dx \, dy.$

This integral is over the half-plane which lies under the line x+y = z.

The key observation is that the function

$f(x)g(y) = (1/2\pi)e^{-(x^2 + y^2)/2}\,$

is radially symmetric. So we rotate the coordinate plane about the origin, choosing new coordinates $x',y'$ such that the line x+y = z is described by the equation $x' = c$ where $c = c(z)$ is determined geometrically. Because of the radial symmetry, we have $f(x)g(y) = f(x')g(y')$, and the CDF for Z is

$\int_{x'\leq c, y' \in \reals} f(x')g(y') \, dx' \, dy'.$

This is easy to integrate; we find that the CDF for Z is

$\int_{-\infty}^{c(z)} f(x') \, dx' = \Phi(c(z)).$

To determine the value $c(z)$, note that we rotated the plane so that the line x+y = z now runs vertically with x-intercept equal to c. So c is just the distance from the origin to the line x+y = z along the perpendicular bisector, which meets the line at its nearest point to the origin, in this case $(z/2,z/2)\,$. So the distance is $c = \sqrt{ (z/2)^2 + (z/2)^2 } = z/\sqrt{2}\,$, and the CDF for Z is $\Phi(z/\sqrt{2})$, i.e., $Z = X+Y \sim N(0, 2).$

Now, if a, b are any real constants (not both zero!) then the probability that $aX+bY \leq z$ is found by the same integral as above, but with the bounding line $ax+by =z$. The same rotation method works, and in this more general case we find that the closest point on the line to the origin is located a (signed) distance

$\frac{z}{\sqrt{a^2 + b^2}}$

away, so that

$aX + bY \sim N(0, a^2 + b^2).$

The same argument in higher dimensions shows that if

$X_i \sim N(0,1), \qquad i=1, \dots, n,$

then

$X_1+ \cdots + X_n \sim N(0, \sigma_1^2 + \cdots + \sigma_n^2).$

Now we are essentially done, because

$X \sim N(\mu,\sigma^2) \Leftrightarrow \frac{1}{\sigma} (X - \mu) \sim N(0,1).$

So in general, if

$X_i \sim N(\mu_i, \sigma_i^2), \qquad i=1, \dots, n,$

then

$\sum_{i=1}^n a_i X_i \sim N\left(\sum_{i=1}^n a_i \mu_i, \sum_{i=1}^n (a_i \sigma_i)^2 \right).$

## Correlated random variables

In the event that the variables X and Y are jointly normally distributed random variables, then X + Y is still normally distributed (see Multivariate normal distribution) and the mean is the sum of the means. However, the variances are not additive due to the correlation. Indeed,

$\sigma_{X+Y} = \sqrt{\sigma_X^2+\sigma_Y^2+2\rho\sigma_X \sigma_Y},$

where ρ is the correlation. In particular, whenever ρ < 0, then the variance is less than the sum of the variances of X and Y. This is perhaps the simplest demonstration of the principle of diversification.

Extensions of this result can be made for more than two random variables, using the covariance matrix.

### Proof

In this case, one needs to consider

$\frac{1}{2 \pi \sigma_x \sigma_y \sqrt{1-\rho^2}} \iint_{x\,y} \exp \left[ -\frac{1}{2(1-\rho^2)} \left(\frac{x^2}{\sigma_x^2} + \frac{y^2}{\sigma_y^2} - \frac{2 \rho x y}{\sigma_x\sigma_y}\right)\right] \delta(z - (x+y))\, \operatorname{d}x\,\operatorname{d}y.$

As above, one makes the substitution $y\rightarrow z-x$

This integral is more complicated to simplify analytically, but can be done easily using a symbolic mathematics program. The probability distribution fZ(z) is given in this case by

$f_Z(z)=\frac{1}{\sqrt{2 \pi}\sigma_+ }\exp\left(-\frac{z^2}{2\sigma_+^2}\right)$

where

$\sigma_+ = \sqrt{\sigma_x^2+\sigma_y^2+2\rho\sigma_x \sigma_y}.$

If one considers instead Z = X − Y, then one obtains

$f_Z(z)=\frac{1}{\sqrt{2\pi(\sigma_x^2+\sigma_y^2-2\rho\sigma_x \sigma_y)}}\exp\left(-\frac{z^2}{2(\sigma_x^2+\sigma_y^2-2\rho\sigma_x \sigma_y)}\right)$

which also can be rewritten with

$\sigma_-=\sqrt{\sigma_x^2+\sigma_y^2-2\rho\sigma_x \sigma_y}.$

The standard deviations of each distribution are obvious by comparison with the standard normal distribution.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 46, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9184503555297852, "perplexity_flag": "head"}