tags:

views:

164

answers:

2

i have X, Y, random logistic variables, how do I add them given the mean and scale for each?

Logistic distribution. i ran a simulation in python, but i cannot get it to be exact.

i ran a simulation on getting a random number X, Y, and keep score on the value of X + Y. then i did the same for getting a single random number with X + Y and test another scale based on the original scales, but i cannot fix the new scale to make them match

+3  A: 

The sum of two logistic random variables does not have a logistic distribution. However, the sum is approximately logistic. You could justify this by arguing that a logistic distribution is approximately normal and the sum of two normal random variables is normal. (This post explains how close the normal and logistic distributions are.)

Say X1 has mean m1 and scale s1 and X2 has mean m2 and scale s2. Then X1 + X2 has mean m1 + m2. X1 has variance pi^2 s1^2 / 3 and X2 has variance pi^2 s2^2 / 3, so X1 + X2 has variance pi^2 (s1^2 + s2^2)/3. This is exact. We know the mean and variance of the sum, though not its exact distribution. But if you're willing to assume that the sum has an approximately logistic distribution, then the corresponding logistic distribution would have mean m1 + m2 and scale sqrt(s1^2 + s2^2).

John D. Cook
+1  A: 

The numpy.random module (sorry for the strange link, but numpy's own site seems to be down right now) has a logistic function that should generate random numbers with a logistic distribution correctly (haven't tested it personally, but I'd be amazed if such a widely used package as numpy made incorrect claims). However, as several comments mentioned, the sum of two logistic-distribution random variables doesn't have logistic distribution itself.

Alex Martelli