Methods and formulas

Poisson reliability factors

For confidence C and k errors, the reliability factor R(C, k) is the Poisson mean lambda for which P(X <= k) = 1 - C. This equals the chi-square quantile chi2(C, 2k+2) / 2 (the gamma relationship) and is found here by bisection on the Poisson CDF.

Monetary unit sampling

Interval and size. With tolerable misstatement TM and expected error count k, interval = TM / R(C, k). Items with |book| >= interval would be selected with certainty, so they are split off as the top stratum and tested 100%; their misstatement is added as known. The rest has value V and n = ceil(V / interval).

Example: TM 5,000, 95%, k = 0, interval = 5,000 / 2.9957 = 1,669.1. Population of 1,000 items at 100 plus one 50,000 item: top = the 50,000 item, V = 100,000, n = 60.

Selection. Items are laid end to end on the absolute-value monetary unit line. Systematic: a seeded random start in [0, interval), then every interval units. Cell: the line is cut into cells of width interval and one seeded random point is drawn per cell. The item containing each point is selected.

Evaluation (separately for overstatement and understatement). Tainting is (book - audited) / |book|, capped at 100%. The sign of the net misstatement decides the direction.

Worked example: interval 10,000, 95%, one item with 20% tainting. PM = 2,000; BP = 29,957.32; IA = (4.7439 - 2.9957 - 1) * 2,000 = 1,496.27; UML = 33,453.59. Against TM 35,000 the population is accepted; against 33,000 it is rejected.

Attribute sampling

Sample size is the smallest n such that, with c = ceil(n * expected_rate) deviations allowed, P(X <= c | n, tolerable_rate) <= 1 - confidence, where X is binomial, or hypergeometric (population size N, D = round(rate * N) deviating items) when a population is given. 95% confidence, 5% tolerable: c = 0, 1, 2, 3 give n = 59, 93, 124, 153.

The upper deviation limit is the smallest rate p with P(X <= k | n, p) <= 1 - confidence. With n = 59, k = 0: 1 - 0.05^(1/59) = 4.95%. A sample equal to the whole population has no sampling error, so the limit is k / N.

Stratification (cumulative sqrt(f))

Values are binned into 100 equal-width classes; the cumulative sum of sqrt(frequency) is cut into L equal parts, and the upper edge of the class where each target is first reached becomes a boundary. Hand example: class frequencies 16, 9, 4, 1 give sqrt(f) = 4, 3, 2, 1, cumulative 4, 7, 9, 10. For two strata the target is 5, first reached in class 2, so the cut is at the upper edge of class 2. Items with |amount| >= the top threshold are removed first and tested 100%.

Variables sampling

For stratum h with N_h items, n_h sampled, finite-population factor (1 - n_h/N_h):

Estimator Estimated total Variance
Mean-per-unit N * mean(audited) N^2 (1-f) s_a^2 / n
Difference Book + N * mean(audited - book) N^2 (1-f) s_d^2 / n
Ratio (sum audited / sum book) * Book N^2 (1-f) s_e^2 / n, e_i = a_i - r b_i, divisor n-1

Strata are summed, variances add, and precision = z * sqrt(total variance) with z the two-sided normal quantile (1.96 at 95%). Fully tested strata (top, or n = N) contribute their audited total and zero variance.

Sizing uses Neyman allocation: n = (z * sum(N_h s_h))^2 / (A^2 + z^2 * sum(N_h s_h^2)) for desired precision A, split as n_h proportional to N_h s_h (at least 2, at most N_h). For mean-per-unit, s_h is the stratum standard deviation of book values; for difference and ratio it is --expected-sd.