# Sum of two normal distributions

#### me_and_my_dog_have_3_legs

##### New Member
Hello,

I'm doing data analysis research and currently I'm trying to fit the simple model to a data sample. From physical speculations
I know that the distribution should be a sum of two normal distributions with different parameters (mean, width, area). I fitted
my data with the model and it works pretty well. For every gaussian I have it's mean, sigma and area and their errors
but I'm wondering how to calculate the parameters(and their errors) of the fitted sum? I was thinking about some kind of
weighted average with weights being the areas of respective functions but I couldn't find any mathematical proof for this.

Regards
M

#### Archidamus

##### Member
A normal distribution can be represented as a sum of infinitely many normal distributions, and in your case just two. This is easy to see/prove when you use moment generating functions. Lets assume Z is your observed data, then you can write it as Z = X + Y. Where the mean of Z needs to be equal to the mean of X + mean of Y. Also, the variance of Z is equal to the Var(X)+Var(Y).

Not sure if this helps, but do explain more so we can help.

#### Dason

##### Ambassador to the humans
Also a normal distribution only takes two parameters but you're talking about three. What are those all representing?

#### StatsWizard

##### New Member
You might find this brief tutorial helpful on combining random variables: http://www.statology.org/combining-random-variables/

Basically, if you have random variables X and Y, then when you add X and Y, you can form a new random variable Z.

The mean of Z is μZ = μX + μY

The variance of Z is var(Z) = var(X) + var(Y)

#### Dason

##### Ambassador to the humans
You're assuming independence there. You need to account for the covariance otherwise. But honestly we typically care about more than just the mean and variance.

#### me_and_my_dog_have_3_legs

##### New Member
Thank You for all replies. I think I wasn't clear with my question and we're talking about two different things. What You refer to is the sum of two (or more) normally distributed random variables. What I am using is a sum (mixture) of two normal distributions, which I use to fit the model with. So the value at x is something like f(x) = A1*f1(x) + A2*f2(x), with A_i being the weight which is basically the height of Gaussian at mean value (cause they're not necessarily normalised). From the fit I got A_i, mu_i, sigma_i and their errors and I want to find the mean of the mixture. Thanks in advance and sorry for late response!

EDIT:

Currently I estimated the mean as:

mu = (A1*mu_1 + A2*mu_2)/(A1+A2),

and calculated it's error from propagation theorem. I'm not sure if it's mathematically justified

Regards
M

Last edited:

#### Dason

##### Ambassador to the humans
Shouldn't the weights (The Ai terms) sum to 1 if it's a proper mixture? Your formula for the mean if the mixture is accurate then but the denominator should reduce to 1.

#### me_and_my_dog_have_3_legs

##### New Member
Thank You. The distribution represents the number of occurrences for a physical process so it's not a probability density normalized to one.

#### Dason

##### Ambassador to the humans
I think some of the details are getting mucked up and it is hard to talk about the technical aspects if we aren't on the same page. Is there a reason you aren't using the canonical way to parameterize a gaussian mixture and instead are using your different offshoot?

#### me_and_my_dog_have_3_legs

##### New Member
You're right. I might be not very clear.
Canonical way to parametrize a mixture, with respective weights summing up to one would give me a pdf in result. I don't want to have that.
Instead I want to have a gaussian-like (or "gaussian mixture like") distribution that is normalized to a certain number (number of occurences), so the
y = f(x) represents the number of occurences for given x, and not the probability. To do it I parametrize a Gaussian with three parameters:
height, mean and sigma:
f_i(x) A_i * N(mean, sigma^2), where N(mean, sigma^2) is the pdf with given mean and sigma.

I added an example in the attachment, where there's cauchy + quadratic background. In my case it's two gaussians.

Thanks

#### Attachments

• 75.1 KB Views: 4