0
$\begingroup$

The two following lines of code does not give the same output. Mathematica manages to calculate the first one but fails to calculate the second one.

PDF[TransformedDistribution[
  a^2, {a \[Distributed] NormalDistribution[0, 1]}], x]

PDF[TransformedDistribution[
  a*b, {a \[Distributed] NormalDistribution[0, 1], 
   b \[Distributed] NormalDistribution[0, 1]}], x]

Why is that?

$\endgroup$
2
$\begingroup$

The two are not equivalent. The first is a one-sided distribution (a^2 is nonnegative) whereas the second is two-sided (a*b is both positive and negative).

You can also generate the first from the HalfNormalDistribution:

Assuming[x > 0,
 PDF[TransformedDistribution[
     a^2, {a \[Distributed] NormalDistribution[0, 1]}], x] ==
   PDF[TransformedDistribution[
     a^2, {a \[Distributed] HalfNormalDistribution[Sqrt[Pi/2]]}], x] //
    Simplify]

True

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.