Hello all,
We had a more difficult question today, given as:
Given a vector with m element (real numbers) I want to compute the PDF for the sum of the m elements considering that each element will have positive or negative sign with equal probability.
First, consider that each element must have its own probability distribution. Since it is real, let me for example assume any element is uniformly distribution between -10 and 10.
UniformDistribution[{-10, 10}]
If all elements are distributed in the same way, the PDF of the sum will be a result of m elements added. So we get:
PDF[TransformedDistribution[
m*x, x \[Distributed] UniformDistribution[{-10, 10}]], x]
However, if you assume a normal distribution centered as 0 for your elements, then you could write:
PDF[TransformedDistribution[
m*x, x \[Distributed] NormalDistribution[0, 1]], x]
Finally, your elements may be distributed in different ways, which could look like something like this, assuming let's say m is 4:
PDF[TransformedDistribution[
a + b + c + d, {a \[Distributed] NormalDistribution[0, 1],
b \[Distributed] NormalDistribution[0, 4],
c \[Distributed] NormalDistribution[0, 19],
d \[Distributed] UniformDistribution[{-10, 10}]}], x]
Another way to intepret your question is to each element is given a binary choice between -1 or 1, but the values are constant. In that case, you may want to apply many distributions to a single sum, which results in this, assume for example this vector:
v = {1.77, 5.65, 10.14, 195.14}
PDF[TransformedDistribution[
v[[1]]*(-1)^a + v[[2]]*(-1)^b + v[[3]]*(-1)^c +
v[[4]]*(-1)^d, {a, b, c, d} \[Distributed]
Table[BernoulliDistribution[0.5], Length[v]]], x]
Hopefully that answers the question. Transformed distributions will be seen in Lesson 20.