Differences between revisions 3 and 9 (spanning 6 versions)
Revision 3 as of 2025-08-06 01:29:27
Size: 1208
Comment: Simplification
Revision 9 as of 2026-08-04 18:05:53
Size: 2286
Comment: Usage notes
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
The '''Bernoulli distribution''' is a discrete probability distribution function, specifically giving outcomes 0 or 1. The '''Bernoulli distribution''' is a discrete probability density function, specifically giving outcomes 0 or 1.
Line 17: Line 17:
The sum of repeated and independent Bernoulli-distributed events are described by the [[Statistics/BinomialDistribution|binomial distribution]]. The sum of repeated and independent Bernoulli-distributed events are described by the [[Analysis/BinomialDistribution|binomial distribution]].
Line 25: Line 25:
The [[Statistics/Moments|first moment]] is ''E[X] = p''. The [[Analysis/ExpectedValue|expected value]] is given as ''E[X] = p''.
Line 27: Line 27:
The variance is ''Var[X] = p(1 - p) = pq''. [[Analysis/Variance|Variance]] is given as ''Var[X] = p(1 - p) = pq''.
Line 37: Line 37:
=== Bernoulli Trials ===

Consider a Bernoulli random variable with probability ''p''. A single trial to observe this variable is called a '''Bernoulli trial'''. The sum of repeated (independent) Bernoulli trials is known to follow a [[Analysis/BinomialDistribution|binomial distribution]]. In other words, if ''X ~ Bernoulli(p)'' then ''nX̅ ~ Binomial(n,p)''.


Line 39: Line 45:
If all frame listings have an equal probability of selection, sampling can be implemented like: Selection for an experiment can be conceptualized as a Bernoulli event.

The natural implementation of a sample is:
Line 48: Line 56:
The expected number of cases sampled is ''np''; the sample size is described by the [[Statistics/BinomialDistribution|binomial distribution]]. The sample size ''np'' is known to follow a [[Analysis/BinomialDistribution|binomial distribution]].



=== Conservative Confidence Interval ===

The variance of a Bernoulli random variable, i.e. ''p(1 - p)'', is maximized by ''p = 1/2''. (The same is true for a [[Analysis/BinomialDistribution|binomial]] random variable; ''Var[X] = np(1 - p)''.) Therefore ''Var[X] ≤ 1/4''. This leads to the concept of a '''conservative confidence interval''' that simply assumes the 'worst case' and sets variance to ''1/4''.

Most often, a '''Wald interval''' is calculated. Following from the '''De Moivre-Laplace theorem''', with a large enough ''n'', a binomial random variable is approximately [[Analysis/NormalDistribution|normal]]. This gives a simple formula:

{{attachment:wald.svg}}

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 expected value is given as E[X] = p.

Variance is given as Var[X] = p(1 - p) = pq.


Usage

Bernoulli Trials

Consider a Bernoulli random variable with probability p. A single trial to observe this variable is called a Bernoulli trial. The sum of repeated (independent) Bernoulli trials is known to follow a binomial distribution. In other words, if X ~ Bernoulli(p) then nX̅ ~ Binomial(n,p).

Sampling

Selection for an experiment can be conceptualized as a Bernoulli event.

The natural implementation of a sample is:

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

The sample size np is known to follow a binomial distribution.

Conservative Confidence Interval

The variance of a Bernoulli random variable, i.e. p(1 - p), is maximized by p = 1/2. (The same is true for a binomial random variable; Var[X] = np(1 - p).) Therefore Var[X] ≤ 1/4. This leads to the concept of a conservative confidence interval that simply assumes the 'worst case' and sets variance to 1/4.

Most often, a Wald interval is calculated. Following from the De Moivre-Laplace theorem, with a large enough n, a binomial random variable is approximately normal. This gives a simple formula:

wald.svg


CategoryRicottone

Analysis/BernoulliDistribution (last edited 2026-08-12 22:16:57 by DominicRicottone)