Re: TransformedDistribution, distribution of a mean

• To: mathgroup at smc.vnet.net
• Subject: [mg120721] Re: TransformedDistribution, distribution of a mean
• From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
• Date: Sun, 7 Aug 2011 06:15:49 -0400 (EDT)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• References: <201108060612.CAA13002@smc.vnet.net>

```You are making many unjustified assumptions here, above of all, that
Mathematica can deal with with sums with a symbolic number of terms and
that you by specifying the distribution for a  Subscript[x, i]  you are
doing it for all values of i. None of these assumptions have any basis
for in the documentation or in standard Mathematica practice. In
fact,for a specific M:

meanZ = TransformedDistribution[Sum[Subscript[x, i]/5,
{i, 1, 5}], (#1 \[Distributed] NormalDistribution[0, 1] & ) /@
Table[Subscript[x, i], {i, 1, 5}]]

NormalDistribution[0, 1/Sqrt[5]]

you get the correct answer, as expected. Note that even here you can't
use Subscript[x, i] \[Distributed] NormalDistribution[0, 1]] - it won't
work and there is no reason why it should.

Here is an explanation of why you get the answer NormalDistribution[0,
1] (you can see it yourself by using Trace).

Mathematica first assumes that Subscript[x,i]  is a normally
distributed random variable and replaces it with \[FormalX]. It only
then looks at the Sum, and computes: Sum[\[FormalX]/M,{i,1,M}], getting
\[FormalX], which naturally is NormalDistribution[0, 1] (since
\[FormalX] is just Subscript[x,i]).

In my opinion there is no bug here of any kind (for except perhaps for
lack of documentation) since Mathematica never will perform any
transformations on expressions such as Sum[Subscript[x,i],{i,1,N}]
unless N is a number or Subscript[x,i] has been defined as an explicit
function of i.

Andrzej Kozlowski

On 6 Aug 2011, at 08:12, paulvonhippel at yahoo wrote:

> I'm getting another odd result using TransformedDistribution.
>
> I define a variable as the mean of M iid standard normal variables.
> When I submit the problem in the following way, Mathematica tells me
> that the mean is also distributed standard normal.
>
> In[1]=    meanZ = TransformedDistribution[Sum[Subscript[x, i]/M,
{i,
> 1, M}],
>  Subscript[x, i] \[Distributed] NormalDistribution[0, 1]]
>
> Out[1]= NormalDistribution[0, 1]
>
>
> This is wrong, of course. The mean of M iid standard normal variables
> is distributed NormalDistribution[0,1/Sqrt[M]].
>
> Why is Mathematica not giving me that answer?
>
> Many thanks,
> Paul
>

```

• Prev by Date: Re: Strange behaviour of NMinimize when doing curve fitting
• Next by Date: Re: Using colored text in PlotLabel
• Previous by thread: Simplifying TransformedDistribution
• Next by thread: am I correctly perceiving a weakness in FinancialDerivative[] ?