       Re: User-defined Probability Mass Function

• To: mathgroup at smc.vnet.net
• Subject: [mg131446] Re: User-defined Probability Mass Function
• From: Murray Eisenberg <murray at math.umass.edu>
• Date: Sun, 7 Jul 2013 23:21:47 -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

```Probably you want:

data = {-2.1, 3.45, 7};
weights = {0.5, 0.3, 0.2};
d = EmpiricalDistribution[weights -> data]

Of course you may enter the data and weights lists directly into the
EmpiricalDistribution expression instead of setting them up before that.

Example:

Probability[x<=3.5,x\[Distributed]d]
0.8

Same thing if you use Pi -- not "pi"!! -- as one of the data points. The
order of the x-values doesn't seem to matter, so long as you associate the
point-masses in the same order.

On Jul 6, 2013, at 5:04 AM, bruce.colletti at gmail.com wrote:

> The questions below can presumably be answered in terms of
ProbabilityDistribution, so here goes...
>
> How do I create a distribution for the discrete random variable whose
support is {-2.1, 3.45, 7} having corresponding probabilities {0.5, 0.3,
0.2}?
>
> What if the support is {-2.1, 3.45, pi}?
>
> If ProbabilityDistribution cannot support these, then what?

---
Murray Eisenberg                                    murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower            phone 413 549-1020 (H)
University of Massachusetts                               413 545-2838 (W)
710 North Pleasant Street                         fax   413 545-1801
Amherst, MA 01003-9305

```

• Prev by Date: Re: Problems Exporting to LaTeX, Windows 8, Mathematica 9
• Next by Date: Re: User-defined Probability Mass Function
• Previous by thread: User-defined Probability Mass Function
• Next by thread: Re: User-defined Probability Mass Function