auditPrior {jfa} | R Documentation |
Audit Sampling: Prior Distributions
Description
auditPrior()
is used to create 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. The function returns an object of
class jfaPrior
that can be used in the planning()
and
evaluation()
functions via their prior
argument. Objects with
class jfaPrior
can be further inspected via associated
summary()
and plot()
methods. They can also be used to compute
a convoluted prior using the +
(for addition) and *
(for
weighing) operators.
Usage
auditPrior(
method = c(
"default", "param", "strict", "impartial", "hyp",
"arm", "bram", "sample", "factor", "nonparam"
),
likelihood = c(
"poisson", "binomial", "hypergeometric",
"normal", "uniform", "cauchy", "t", "chisq",
"exponential"
),
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,
samples = NULL,
conf.level = 0.95
)
Arguments
method |
a character specifying the method by which the prior
distribution is constructed. Possible options are |
likelihood |
a character specifying the likelihood for updating the
prior distribution. Possible options are |
N.units |
a numeric value larger than 0 specifying the total number
of units in the population. Required for the |
alpha |
a numeric value specifying the |
beta |
a numeric value specifying the |
materiality |
a numeric value between 0 and 1 specifying the
performance materiality (i.e., the maximum tolerable misstatement in the
population) as a fraction. Required for methods |
expected |
a numeric value between 0 and 1 specifying the expected
(tolerable) misstatements in the sample relative to the total sample size.
Required for methods |
ir |
a numeric value between 0 and 1 specifying the inherent
risk (i.e., the probability of material misstatement occurring due to
inherent factors) in the audit risk model. Required for method |
cr |
a numeric value between 0 and 1 specifying the internal
control risk (i.e., the probability of material misstatement occurring due
to internal control systems) in the audit risk model. Required for method
|
ub |
a numeric value between 0 and 1 specifying the
|
p.hmin |
a numeric value between 0 and 1 specifying the prior
probability of the hypothesis of tolerable misstatement (H1: |
x |
a numeric value larger than, or equal to, 0 specifying the
sum of proportional misstatements (taints) in a prior sample. Required for
methods |
n |
a numeric value larger than 0 specifying the number of
units in a prior sample. Required for methods |
factor |
a numeric value between 0 and 1 specifying the weight of
a prior sample specified via |
samples |
a numeric vector containing samples of the prior
distribution. Required for method |
conf.level |
a numeric value between 0 and 1 specifying the confidence level (1 - audit risk). |
Details
To perform Bayesian audit sampling you must assign a prior
distribution to the parameter in the model, i.e., the population
misstatement \theta
. The prior distribution can incorporate
pre-existing audit information about \theta
into the analysis, which
consequently allows for a more efficient or more accurate estimates. The
default priors used by jfa
are indifferent towards the possible
values of \theta
, while still being proper. Note that the default
prior distributions are a conservative choice of prior since they, in most
cases, assume all possible misstatement to be equally likely before seeing
a data sample. It is recommended to construct an informed prior
distribution based on pre-existing audit information when possible.
This section elaborates on the available input options for the
method
argument.
default
: This method produces a gamma(1, 1), beta(1, 1), beta-binomial(N, 1, 1), normal(0.5, 1000) , cauchy(0, 1000), student-t(1), or chi-squared(1) prior distribution. These prior distributions are mostly indifferent about the possible values of the misstatement.param
: This method produces a customgamma(alpha, beta)
,beta(alpha, beta)
,beta-binomial(N, alpha, beta)
prior distribution, normal(alpha, beta), cauchy(alpha, beta), student-t(alpha), or chi-squared(alpha). The alpha and beta parameters must be set usingalpha
andbeta
.strict
: This method produces an improper gamma(1, 0), beta(1, 0), or beta-binomial(N, 1, 0) prior distribution. These prior distributions match sample sizes and upper limits from classical methods and can be used to emulate classical results.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.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 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 the outcome of an earlier sample to a prior distribution.factor
: This method translates and weighs the outcome of an earlier sample to a prior distribution.nonparam
: This method takes a vector of samples from the prior distribution (viasamples
) and constructs a bounded density (between 0 and 1) on the basis of these samples to act as the prior.
This section elaborates on the available input options for the
likelihood
argument and the corresponding conjugate prior
distributions used by jfa
.
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)}
.
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 |
hypotheses |
if |
method |
a character indicating the method by which the prior distribution is constructed. |
likelihood |
a character indicating the likelihood of the data. |
materiality |
if |
expected |
a numeric value larger than, or equal to, 0 giving the input for the number of expected misstatements. |
conf.level |
a numeric value between 0 and 1 giving the confidence level. |
N.units |
if |
Author(s)
Koen Derks, k.derks@nyenrode.nl
References
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. doi:10.1111/ijau.12240
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. doi:10.21105/joss.02733
Derks, K., de Swart, J., Wagenmakers, E.-J., & Wetzels, R. (2022). An impartial Bayesian hypothesis test for audit sampling. PsyArXiv. doi:10.31234/osf.io/8nf3e
See Also
Examples
# Default beta prior
auditPrior(likelihood = "binomial")
# Impartial prior
auditPrior(method = "impartial", materiality = 0.05)
# Non-conjugate prior
auditPrior(method = "param", likelihood = "normal", alpha = 0, beta = 0.1)