       Re: Bug with ProbabilityDistribution

• To: mathgroup at smc.vnet.net
• Subject: [mg132548] Re: Bug with ProbabilityDistribution
• From: Barrie Stokes <barrie.stokes at newcastle.edu.au>
• Date: Thu, 10 Apr 2014 03:09:38 -0400 (EDT)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• Delivered-to: l-mathgroup@wolfram.com
• Delivered-to: mathgroup-outx@smc.vnet.net
• Delivered-to: mathgroup-newsendx@smc.vnet.net

```Hi Charles

Writing

scriptD = ProbabilityDistribution[
Piecewise[{{0, x1 == 1 && x2 == 1}, {1/2, x1 == 1 && x2 == 0}, {0,
x1 == 0 && x2 == 1}, {1/2, x1 == 0 && x2 == 0}}],
{x1, 0, 1, 1}, {x2, 0, 1, 1}
],

PDF[  scriptD, {x, y}]  looks interesting, and

CDF[  scriptD, {x, y}]  gives Undefined.

OTOH,

Mean[scriptD ] gives (1=8E2, 0)

And

Variance[scriptD ] gives {1=8E4, 0}

whereas

Covariance[scriptD ] doesn't work.

DiscretePlot3D[ PDF[  scriptD, {x, y}], {x, -2, 2}, {y, -2, 2},
AxesLabel -> {"x", "y", "PDF"} ]

Corroborates

PDF[  scriptD, {1, 1}]
PDF[  scriptD, {0, 1}]
PDF[  scriptD, {1, 0}]
PDF[  scriptD, {0, 0}]

If you look closely.

I note that there is documentation in V.9 for Discrete Univariate
Distributions, but I don't see anything under "Discrete Multivariate
Distributions"

Hmmm.

Cheers

Barrie

On 9/04/14 6:14 PM, "CHARLES GILLINGHAM" <cgillingham1 at me.com> wrote:

>Evaluate this:
>
>	ProbabilityDistribution[
> 		Piecewise[{{0, x1 == 1 && x2 == 1}, {1/2, x1 == 1 && x2 == 0}, {0, x1
>== 0 && x2 == 1}, {1/2, x1 == 0 && x2 == 0}}],
>		 {x1, 0, 1, 1}, {x2, 0, 1, 1}
>	 ]
>	PDF[%][{1, 1}]
>
>And you get:
>
>	Undefined
>
>But the probability is obviously 0
>
>Is there something I am misunderstanding about how simple Boolean
>probability distributions should be set up?
>
>Thanks.
>
>
>
>

```

• Prev by Date: Runge-Kutta 2
• Next by Date: Controlling breaking of lines in output of Write
• Previous by thread: Variables in ProbabilityDistribution have strange "scoping" mechanism
• Next by thread: Try to choose an informative subject line. Was: Re: question