Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15141 > unrolled thread

Re: User-defined Probability Mass Function

Started byMurray Eisenberg <murray@math.umass.edu>
First post2013-07-08 03:18 +0000
Last post2013-07-08 03:18 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: User-defined Probability Mass Function Murray Eisenberg <murray@math.umass.edu> - 2013-07-08 03:18 +0000

#15141 — Re: User-defined Probability Mass Function

FromMurray Eisenberg <murray@math.umass.edu>
Date2013-07-08 03:18 +0000
SubjectRe: User-defined Probability Mass Function
Message-ID<krdb1j$epk$1@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@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@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

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web