auditPrior() is used to specify a prior distribution for Bayesian audit sampling. The interface allows a complete customization of the prior distribution as well as a formal translation of pre-existing audit information into a prior distribution. auditPrior() returns an object of class jfaPrior that can be subsequently used in the planning() and evaluation() functions via their prior argument. Objects with class jfaPrior can be used with associated summary() and plot() methods.

For more details on how to use this function, see the package vignette: vignette('jfa', package = 'jfa')

## Usage

auditPrior(method = c(
"default", "strict", "param", "impartial", "hyp",
"arm", "bram", "sample", "factor"
), likelihood = c('poisson', 'binomial', 'hypergeometric'),
N.units = NULL, alpha = NULL, beta = NULL,
materiality = NULL, expected = 0, ir = NULL, cr = NULL,
ub = NULL, p.hmin = NULL, x = NULL, n = NULL,
factor = NULL, conf.level = 0.95)

## Arguments

method

a character specifying the method by which the prior distribution is constructed. Possible options are default, strict, impartial, param, arm, bram, hyp, sample, and factor. See the details section for more information.

likelihood

a character specifying the likelihood for updating the prior distribution. Possible options are poisson (default) for a conjugate gamma prior distribution, binomial for a conjugate beta prior distribution, or hypergeometric for a conjugate beta-binomial prior distribution. See the details section for more information.

N.units

a numeric value larger than 0 specifying the total number of units in the population. Only used for the hypergeometric likelihood.

alpha

a numeric value specifying the $$\alpha$$ parameter of the prior distribution. Only used for method param.

beta

a numeric value specifying the $$\beta$$ parameter of the prior distribution. Only used for method param.

materiality

a numeric value between 0 and 1 specifying the performance materiality (i.e., the maximum tolerable misstatement) as a fraction of the total number of units in the population. Only used for methods impartial, arm, and hyp.

expected

a numeric value between 0 and 1 specifying the expected errors in the sample relative to the total sample size. Only used for methods impartial, arm, bram, and hyp.

ir

a numeric value between 0 and 1 specifying the inherent risk in the audit risk model. Only used for method arm.

cr

a numeric value between 0 and 1 specifying the internal control risk in the audit risk model. Only used for method arm.

ub

a numeric value between 0 and 1 specifying the conf.level-% upper bound for the prior distribution as a fraction of the total number of units in the population. Only used for method bram.

p.hmin

a numeric value between 0 and 1 specifying the prior probability of the hypothesis of tolerable misstatement (H1: $$\theta <$$ materiality). Only used for method hyp.

x

a numeric value larger than, or equal to, 0 specifying the sum of proportional errors (taints) in a prior sample. Only used for methods sample and factor.

n

a numeric value larger than 0 specifying the sample size of a prior sample. Only used for methods sample and factor.

factor

a numeric value between 0 and 1 specifying the weight of the prior sample. Only used for method factor.

conf.level

a numeric value between 0 and 1 specifying the confidence level.

## Value

An object of class jfaPrior containing:

prior

a string describing the functional form of the prior distribution.

description

a list containing a description of the prior distribution, including the parameters of the prior distribution and the implicit sample on which the prior distribution is based.

statistics

a list containing statistics of the prior distribution, including the mean, mode, median, and upper bound of the prior distribution.

specifics

a list containing specifics of the prior distribution that vary depending on the method.

hypotheses

if materiality is specified, a list containing information about the hypotheses, including prior probabilities and odds for the hypothesis of tolerable misstatement (H1) and the hypothesis of intolerable misstatement (H0).

method

a character indicating the method by which the prior distribution is constructed.

likelihood

a character indicating the likelihood of the data.

materiality

if materiality is specified, a numeric value between 0 and 1 giving the materiality used to construct the prior distribution.

expected

a numeric value larger than, or equal to, 0 giving the input for the number of expected errors.

conf.level

a numeric value between 0 and 1 giving the confidence level.

N.units

if N.units is specified, the number of units in the population.

## Details

To perform Bayesian audit sampling you must assign a prior probability distribution to the parameter in the model, i.e., the population misstatement $$\theta$$. The prior distribution can incorporate pre-existing audit information about $$\theta$$ before seeing a sample, which consequently allows for a more efficient or more accurate estimate of $$\theta$$. However, the default priors used in jfa are purposely indifferent towards the individual values of $$\theta$$ in order to 'let the data speak for themselves'. Note that these default priors are a conservative choice of prior since they assume all possible misstatement to be (roughly) equally likely before seeing a data sample. It is therefore strongly recommended to construct an informed prior distribution based on pre-existing audit information if possible.

This section elaborates on the available options for the method argument.

• default: This method produces a gamma(1, 1), beta(1, 1), or beta-binomial(N, 1, 1) prior distribution. These priors are indifferent towards the possible values of the misstatement.

• strict: This method produces an improper gamma(1, 0), beta(1, 0), or beta-binomial(N, 1, 0) prior distribution. These prior distributions exactly match sample sizes and upper limits from classical methods.

• impartial: This method produces an impartial prior distribution. These prior distributions assume that tolerable misstatement ($$\theta <$$ materiality) and intolerable misstatement ($$\theta >$$ materiality) are equally likely.

• param: This method produces a gamma(alpha, beta), beta(alpha, beta), or beta-binomial(N, alpha, beta) prior distribution.

• hyp: This method translates an assessment of the prior probability for tolerable misstatement ($$\theta <$$ materiality) to a prior distribution.

• arm: This method translates an assessment of inherent risk and internal control risk (Audit Risk Model, Derks et al., 2021) to a prior distribution.

• bram: This method translates an assessment of the expected most likely error and x-% upper bound to a prior distribution.

• sample: This method translates sampling results from an earlier sample to a prior distribution.

• factor: This method translates and weighs sampling results from an earlier sample to a prior distribution.

This section elaborates on the available likelihoods and corresponding prior distributions for the likelihood argument.

• poisson: The Poisson distribution is an approximation of the binomial distribution. The Poisson distribution is defined as: $$f(\theta, n) = \frac{\lambda^\theta e^{-\lambda}}{\theta!}$$ The conjugate gamma($$\alpha, \beta$$) prior has probability density function: $$p(\theta; \alpha, \beta) = \frac{\beta^\alpha \theta^{\alpha - 1} e^{-\beta \theta}}{\Gamma(\alpha)}$$

• binomial: The binomial distribution is an approximation of the hypergeometric distribution. The binomial distribution is defined as: $$f(\theta, n, x) = {n \choose x} \theta^x (1 - \theta)^{n - x}$$ The conjugate beta($$\alpha, \beta$$) prior has probability density function: $$p(\theta; \alpha, \beta) = \frac{1}{B(\alpha, \beta)} \theta^{\alpha - 1} (1 - \theta)^{\beta - 1}$$

• hypergeometric: The hypergeometric distribution is defined as: $$f(x, n, K, N) = \frac{{K \choose x} {N - K \choose n - x}}{{N \choose n}}$$ The conjugate beta-binomial($$\alpha, \beta$$) prior (Dyer and Pierce, 1993) has probability mass function: $$f(x, n, \alpha, \beta) = {n \choose x} \frac{B(x + \alpha, n - x + \beta)}{B(\alpha, \beta)}$$

## References

Derks, K., de Swart, J., Wagenmakers, E.-J., Wille, J., & Wetzels, R. (2021). JASP for audit: Bayesian tools for the auditing practice. Journal of Open Source Software, 6(68), 2733.

Derks, K., de Swart, J., van Batenburg, P., Wagenmakers, E.-J., & Wetzels, R. (2021). Priors in a Bayesian audit: How integration of existing information into the prior distribution can improve audit transparency and efficiency. International Journal of Auditing, 25(3), 621-636.

planning selection evaluation report

## Author

Koen Derks, k.derks@nyenrode.nl

## Examples

# Default uniform beta(1, 1) prior distribution
auditPrior(method = "default", likelihood = "binomial")
#>
#> 	Prior Distribution for Audit Sampling
#>
#> functional form: beta(α = 1, β = 1)
#> parameters obtained via method 'default'

# Translate inherent risk (ir) and control risk (cr) to a gamma prior distribution
auditPrior(method = "arm", expected = 0.025, materiality = 0.05, ir = 1, cr = 0.6)
#>
#> 	Prior Distribution for Audit Sampling
#>
#> functional form: gamma(α = 2.325, β = 53)
#> parameters obtained via method 'arm'

# Impartial beta prior distribution (equal prior probabilities)
auditPrior(method = "impartial", likelihood = "binomial", materiality = 0.05)
#>
#> 	Prior Distribution for Audit Sampling
#>
#> functional form: beta(α = 1, β = 13.513)
#> parameters obtained via method 'impartial'