binomial#

View page source

Binomial Distribution#

In some cases, the dismod_at measured value meas_value is closely approximated by a binomial distribution. In this section we derive an approximation for the corresponding measurement standard deviation meas_std .

Notation#

n

number of samples

p

probability of success for each sample

k

number of success events

r

success ratio; i.e., r = k / n

\(\sigma\)

approximate standard deviation of the success ratio r

Variance#

The variance of \(k\) is given by

\[\B{V} [ k ] = n p (1 - p)\]

Converting from \(k\) to \(r\) we have

\[\B{V} [ r ] = p (1 - p) / n\]

When the data is binomial, we measure k and know n, but we do not know p . Using a uniform prior on p, the expected value of p given k is

\[\B{E} [ p | k ] = (k + 1) / (n + 2)\]

See Estimation of Parameters for a binomial distribution.

Approximation#

Using this \(\B{E} [ p | k ] = (k + 1) / (n + 2)\) as an approximation for p, the corresponding approximation for the variance give the number of success events k is

\[\B{V} [ r ] \approx \frac{ (k + 1) (n + 1 - k) }{ n ( n + 2 )^2 }\]

If r is the dismod_at measured value meas_value , the corresponding standard deviation meas_std is the square root of the variance approximation above; i.e.,

\[\sigma = \frac{1}{n + 2} \sqrt{ \frac{ (k + 1) (n + 1 - k) }{ n } }\]

In some cases r / T is the dismod_at measured value, where T is the total time for the experiment. In this case the corresponding standard deviation is \(\sigma / T\) .

Example#

The user_binomial.py file contains an example and test of standard deviation approximation above.