Differences between revisions 1 and 2
Revision 1 as of 2024-06-14 15:43:35
Size: 981
Comment: Initial commit
Revision 2 as of 2025-04-08 15:20:42
Size: 1032
Comment: Typo and reorg
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
The '''Bernoulli distribution''' is a discrete propability distribution that gives 1 with probability ''p'' and 0 with probability ''q = 1 - p''. The '''Bernoulli distribution''' is a discrete probability distribution that gives 1 with probability ''p'' and 0 with probability ''q = 1 - p''.
Line 11: Line 11:
== Statistics == == Description ==
Line 13: Line 13:
The expected value of a Bernoulli-ditributed variable is ''E[X] = p''.

The variance of a Bernoulli-distributed variable is ''Var[X] = p(1 - p) = pq''.
The distribution is appropriate for modeling any binary outcome.
Line 23: Line 21:
== Sampling == == Statistics ==

The expected value is ''E[X] = p''.

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

----



== Usage ==



=== Sampling ===

Bernoulli Distribution

The Bernoulli distribution is a discrete probability distribution that gives 1 with probability p and 0 with probability q = 1 - p.


Description

The distribution is appropriate for modeling any binary outcome.

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


Statistics

The expected value 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

Statistics/BernoulliDistribution (last edited 2025-04-08 15:20:42 by DominicRicottone)