Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #15141
| From | Murray Eisenberg <murray@math.umass.edu> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: User-defined Probability Mass Function |
| Date | 2013-07-08 03:18 +0000 |
| Message-ID | <krdb1j$epk$1@smc.vnet.net> (permalink) |
| Organization | Time-Warner Telecom |
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
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: User-defined Probability Mass Function Murray Eisenberg <murray@math.umass.edu> - 2013-07-08 03:18 +0000
csiph-web