# Gamma verdeling

The Gamma probability distribution is very useful to express the presumed prevalence of errors in a population. It has 2 parameters, a and b, representing shape and scale. The most likely error is (a-1)b but 0 when a <1; an upper error limit can be derived from the standard Excel function GAMMAINV(confidence level; a;b). Mean and variance are ab and ab2 respectively.

Graphically, a Gamma distribution can be shaped in many forms: A sample of n items from a population of M monetary units with k errors has a most likely error of k M/n and a maximum error of GAMMAINV(confidence, k+1, M/n). This makes b to be estimated by M/n and a by k+1.

These formulas can be used to design and evaluate sample results. One detail: the Excel function GAMMINV(confidence;a;b) is not reliable for large b and for calculations one should use its scaling property giving GAMMAINV(confidence;a;1) x b.

Sample expansion to improve the accuracy of estimated adjustments

Expanding a sample after finding too many errors to a new sample size for which the number of errors found is acceptable, increases the risk of incorrect acceptance. Therefore, if the original sample size was designed based on tolerated risk, sample expansion will imply that tolerated risk is exceeded and required assurane cannot be achieved.

This implies that when the number of errors exceeds the planned number, sample expansion does not solve the consequence that estimated maximum error exceeds materiality. If the estimated maximum error exceeds materiality, the amount to be inspected needs to be corrected before it can be accepted.  The most likely error amount is the best candidate for the amount to be corrected,  but even after that correction, the estimated maximum error may still exceed materiality. In that situation, sample expansion can be a good tool to reduce precision, being the distance between the estimated maximum error and the most likely error. A spreadsheet can be developed based on the following formulae:

Population M, materiality

First sample n1, Number of errors k1

Most likely error k1 M/n1

Maximum error GAMMAINV(confidence, k1+1,M/n1)

Precision1 = Maximum error minus most likely error

Second sample n2, presumed additional errors k2 = k1 (n2/n1) (this is an essential assumption!)

Most likely error (k1+k2) M/(n1+n2)

Maximum error GAMMAINV(confidence, k1+k2+1,M/(n1+n2))

Precision2 = Maximum error minus most likely error

With goal seek one can find n2 so that Precision2 meets materiality.

This results in an additional sample size that, assuming it will pick up additional errors in the same fraction as in the first sample, will yield a precise enough estimate of the amount to be corrected before accepting the population. Roughly, each additional error can be overcome by 1/3 of sample size.

Consequences of changes in the sampling plan during the year

MUS samples can only be evaluated properly when the interval J = M/n is kept constant over the entire population. Underestimation of the population size therefore may lead to too much work, but adjusting J during the year leads to aggregation problems. Stewart et al. have proposed an approximation to the gamma aggregation.

If n1 were selected from M1 with k1 errors and n2 from M2 with k2, we have k1 Gamma distributed with a1 = k1+1 and b1 = M1/n1 yielding an expected value of a1b1 and a variance of a1b1^2 and k2 Gamma distributed with a2 = k2+1 and b2= M2/n2 yielding an expected value of a2b2 and variance a2b2^2 so overall k is approximately Gamma distributed with expectation a1b1+a2b2 and variance a1b1^2 + a2b2^2. This gives us overall b as variance divided by expectation and overall a as expectation divided by b.

As a result we now know the probability distribution of the overall error in 2 heterogeneous subpopulations.  This allows us to aggregate sample results that were sampled with different intervals.

An easier description of the audit risk model

Bayesian inference is based on prior knowledge about the population error that is combined with sample results to draw an overall conclusion.

Combining a prior that is Gamma with parameters a and b with a sample of n from M with k errors, the result is a Gamma posterior with parameter a+k and 1/(1/b+n/M) (re Leonard and Hsu). Given the presumed prior parameters we can use goal seek to determine the sample size (with a number of errors consistent with prior parameters) to achieve a required posterior.

Materiality setting

When a population to be audited consists of 2 heterogeneous parts, overall materiality needs to be set for the subpopulations in such a way that if both populations are evaluated with an estimated maximum error below their materialities, the aggregated overall estimated maximum error meets the stipulated overall materiality. Materiality setting does not require allocation (sub populations to add up to overall materiality) since the chance of both errors exceeding their materialities is very small (1-(1-0,05)^n for n 95% upper error limits, for example).

The great advantage of materiality setting is that the assumed heterogeneity allows the evaluation of errors in a subpopulation to be restricted to that subpopulation only. Errors may now be isolated to the sub population were they were found; similar error causes may have been present in other sub populations but if their prevalence is material it will be indicated by sampling on those sub populations.

There is an infinite number of combinations of useful subpopulation materialities; Stewart and Kinney (to be published) show that square roots or relative sizes are the weights to be applied to sub populations to minimize total sample size.

Audit on an overall population to give assurance on sub populations (shared services audit)

The completely opposite situation to materiality allocation is where a homogeneous population is audited but audit results are required about sub populations and materialities for these sub populations have been set that are lower than overall materiality. Instead of designing samples for each sub population, a two step approach is much more efficient. In the first step an overall sample is designed based on overall materiality. The result of this sample is expressed in a posterior probability function that can be fractionalized into priors for the subpopulations.  Each subpopulation receives a Gamma prior with a times the relative size of the subpopulation as first, and b as second parameters.  From here, Bayesian models can be built for each sub population to determine the required additional sample.