Differences between revisions 2 and 7 (spanning 5 versions)
Revision 2 as of 2025-04-08 15:20:42
Size: 1032
Comment: Typo and reorg
Revision 7 as of 2026-02-17 15:25:34
Size: 1223
Comment: Links
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
The '''Bernoulli distribution''' is a discrete probability distribution that gives 1 with probability ''p'' and 0 with probability ''q = 1 - p''. The '''Bernoulli distribution''' is a discrete probability density function, specifically giving outcomes 0 or 1.
Line 13: Line 13:
The distribution is appropriate for modeling any binary outcome. The distribution gives outcome 1 with probability ''p'', and 0 with probability ''q = 1 - p''. It is appropriate for modeling any binary event.
Line 15: Line 15:
The sum of repeated and independent Bernoulli-distributed events are described by the [[Statistics/BinomialDistribution|binomial distribution]]. A variable distributed this way is notated like ''X ~ Bernoulli(p)''. (Sometimes shortened to 'Bern'.)

The sum of repeated and independent Bernoulli-distributed events are described by the [[Analysis/BinomialDistribution|binomial distribution]].
Line 21: Line 23:
== Statistics == == Moments ==
Line 23: Line 25:
The expected value is ''E[X] = p''. The [[Statistics/Moments|first moment]] is ''E[X] = p''.
Line 25: Line 27:
The variance is ''Var[X] = p(1 - p) = pq''. The [[Statistics/Variance|variance]] is ''Var[X] = p(1 - p) = pq''.
Line 46: Line 48:
The expected number of cases sampled is ''np''; the sample size is described by the [[Statistics/BinomialDistribution|binomial distribution]]. The expected number of cases sampled is ''np''; the sample size is described by the [[Analysis/BinomialDistribution|binomial distribution]].

Bernoulli Distribution

The Bernoulli distribution is a discrete probability density function, specifically giving outcomes 0 or 1.


Description

The distribution gives outcome 1 with probability p, and 0 with probability q = 1 - p. It is appropriate for modeling any binary event.

A variable distributed this way is notated like X ~ Bernoulli(p). (Sometimes shortened to 'Bern'.)

The sum of repeated and independent Bernoulli-distributed events are described by the binomial distribution.


Moments

The first moment is E[X] = p.

The variance is Var[X] = p(1 - p) = pq.


Usage

Sampling

If all frame listings have an equal probability of selection, sampling can be implemented like:

scalar p = .2 /* Probability of selection */
set seed 123456789
generate double r = runiform()
generate sampled = (r < p)

The expected number of cases sampled is np; the sample size is described by the binomial distribution.


CategoryRicottone

Analysis/BernoulliDistribution (last edited 2026-02-17 15:25:34 by DominicRicottone)