Message Boards Message Boards

0
|
5198 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Is there a bug in the TransformedDistribution function?

Posted 9 years ago
POSTED BY: Mike Luntz
3 Replies
Posted 9 years ago
POSTED BY: Jim Baldwin
Posted 9 years ago

Just an update:

When I explicitly use a Bernoulli distribution instead of a single sample of the Binomial distribution the transformation yields the correct result.

 w = TransformedDistribution[2 x - 1, x \[Distributed] BernoulliDistribution[1/2]]
 PDF[w][Range[-2, 2]]
 {0, 1/2, 0, 1/2, 0}
POSTED BY: Mike Luntz

Mike,

It seems to be a problem of how the PDF function is mapping itself onto a list, rather than a problem with TransformedDistribution. I get the correct answer with:

PDF[z, #] & /@ Range[-2, 2]
{0, 1/2, 0, 1/2, 0}

Which shows that the PDF function itself is fine. I get the wrong answer even if I do:

 PDF[z, {-1, 0}]
{1/2, 2/\[Pi]}

Cannot say that I understand why. The function description states that it is Listable.

Best,

OL.

POSTED BY: Otto Linsuain
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract