vignettes/v2priorDistributions.Rmd
v2priorDistributions.Rmd
Bayesian statistics allows you to incorporate existing information into the statistical analysis and revise this information using the information from the sample, possibly increasing your efficiency in the sampling procedure. For example, when you have information that indicates a low-risk profile for your client, you may require less evidence from the audit sampling procedures. Be aware that all information that you incorporate into the statistical analysis should be justified.
Bayesian statistics incorporates existing information into the sampling procedure using a prior probability distribution that reflects your current knowledge about the misstatement in the population. The prior distribution is created using existing information, and is therefore generally created before the planning stage in the procedure.
An important question is how to incorporate various kinds of existing information into the prior distribution. jfa
offers six methods to create a prior distribution. These methods are explained below.
First, let’s set some default options for the confidence, performance materiality, the likelihood, and the expected errors.
confidence <- 0.95 # 95% confidence
likelihood <- "binomial" # Binomial likelihood
materiality <- 0.05 # Performance materiality of 5%
expectedError <- 0 # Zero errors expected in sample
method = "none"
)You can refrain from incorporating explicit information in the prior distribution, and still use Bayesian statistics, using method = none
. As an example, the code below incorporates no explicit information into a prior distribution
prior1 <- auditPrior(confidence = confidence, likelihood = likelihood, expectedError = expectedError,
materiality = materiality, method = "none")
prior1
## # ------------------------------------------------------------
## # jfa Prior Distribution Summary (Bayesian)
## # ------------------------------------------------------------
## # Input:
## #
## # Confidence: 95%
## # Expected sample errors: 0%
## # Likelihood: binomial
## # Specifics: None
## # ------------------------------------------------------------
## # Output:
## #
## # Prior distribution: beta(α = 1, β = 1)
## # Implicit sample size: 0
## # Implicit errors: 0
## # ------------------------------------------------------------
## # Statistics:
## #
## # Upper bound: 0.95
## # Precision: NaN
## # Mode: NaN
## # Mean: 0.5
## # Median: 0.5
## # ------------------------------------------------------------
You can visually inspect the prior distribution using the plot()
function.
plot(prior1)
method = "arm"
)You can incorporate the risk assessments from the Audit Risk Model (inherent risk and internal control risk) using method = "arm
in combination with the ir
and cr
arguments. As an example, the code below incorporates the information that the inherent risk is equal to 90% and that the internal control risk is equal to 60% into a prior distribution.
prior2 <- auditPrior(confidence = confidence, likelihood = likelihood, expectedError = expectedError,
materiality = materiality, method = "arm", ir = 0.9, cr = 0.6)
prior2
## # ------------------------------------------------------------
## # jfa Prior Distribution Summary (Bayesian)
## # ------------------------------------------------------------
## # Input:
## #
## # Confidence: 95%
## # Expected sample errors: 0%
## # Likelihood: binomial
## # Specifics: Inherent risk = 0.9; Internal control risk = 0.6; Detection risk = 0.09
## # ------------------------------------------------------------
## # Output:
## #
## # Prior distribution: beta(α = 1, β = 13)
## # Implicit sample size: 12
## # Implicit errors: 0
## # ------------------------------------------------------------
## # Statistics:
## #
## # Upper bound: 0.21
## # Precision: 0.21
## # Mode: 0
## # Mean: 0.07
## # Median: 0.05
## # ------------------------------------------------------------
You can visually inspect the prior distribution using the plot()
function.
plot(prior2)
method = "median"
)You can incorporate the assumption that tolerable misstatement is equally likely as intolerable misstatement using method = "median"
. As an example, the code below incorporates this assumption into a prior distribution.
Note: This method requires that you specify a value for the materiality
.
prior3 <- auditPrior(confidence = confidence, likelihood = likelihood, expectedError = expectedError,
materiality = materiality, method = "median")
prior3
## # ------------------------------------------------------------
## # jfa Prior Distribution Summary (Bayesian)
## # ------------------------------------------------------------
## # Input:
## #
## # Confidence: 95%
## # Expected sample errors: 0%
## # Likelihood: binomial
## # Specifics: p(Θ < 0.05) = p(Θ > 0.05) = 0.5
## # ------------------------------------------------------------
## # Output:
## #
## # Prior distribution: beta(α = 1, β = 13.513)
## # Implicit sample size: 12.51
## # Implicit errors: 0
## # ------------------------------------------------------------
## # Statistics:
## #
## # Upper bound: 0.2
## # Precision: 0.2
## # Mode: 0
## # Mean: 0.07
## # Median: 0.05
## # ------------------------------------------------------------
You can visually inspect the prior distribution using the plot()
function.
plot(prior3)
method = "hypotheses"
)You can assign custom probabilities to the hypothesis of tolerable misstatement (using pHmin
) and/or the hypotheses of intolerable misstatement (using pHplus
) in combination with method = "hypotheses
. As an example, the code below incorporates the information that the hypothesis of tolerable misstatement has a probability of 60% into a prior distribution.
Note: This method requires that you specify a value for the materiality
and that the expected errors are zero.
prior4 <- auditPrior(confidence = confidence, likelihood = likelihood, expectedError = expectedError,
materiality = materiality, method = "hypotheses", pHmin = 0.6)
prior4
## # ------------------------------------------------------------
## # jfa Prior Distribution Summary (Bayesian)
## # ------------------------------------------------------------
## # Input:
## #
## # Confidence: 95%
## # Expected sample errors: 0%
## # Likelihood: binomial
## # Specifics: p(Θ < 0.05) = 0.6; p(Θ > 0.05) = 0.4
## # ------------------------------------------------------------
## # Output:
## #
## # Prior distribution: beta(α = 1, β = 17.864)
## # Implicit sample size: 16.86
## # Implicit errors: 0
## # ------------------------------------------------------------
## # Statistics:
## #
## # Upper bound: 0.15
## # Precision: 0.15
## # Mode: 0
## # Mean: 0.05
## # Median: 0.04
## # ------------------------------------------------------------
You can visually inspect the prior distribution using the plot()
function.
plot(prior4)
method = "sample"
)You can incorporate information from an earlier sample into the prior distribution using method = "sample
in combination with sampleN
and sampleK
. As an example, the code below incorporates the information from an earlier sample of 30 transactions, in which 0 misstatements were found, into a prior distribution.
prior5 <- auditPrior(confidence = confidence, likelihood = likelihood, expectedError = expectedError,
materiality = materiality, method = "sample", sampleN = 30, sampleK = 0)
prior5
## # ------------------------------------------------------------
## # jfa Prior Distribution Summary (Bayesian)
## # ------------------------------------------------------------
## # Input:
## #
## # Confidence: 95%
## # Expected sample errors: 0%
## # Likelihood: binomial
## # Specifics: Earlier sample of 30 transactions with 0 errors
## # ------------------------------------------------------------
## # Output:
## #
## # Prior distribution: beta(α = 1, β = 31)
## # Implicit sample size: 30
## # Implicit errors: 0
## # ------------------------------------------------------------
## # Statistics:
## #
## # Upper bound: 0.09
## # Precision: 0.09
## # Mode: 0
## # Mean: 0.03
## # Median: 0.02
## # ------------------------------------------------------------
You can visually inspect the prior distribution using the plot()
function.
plot(prior5)
method = "factor"
)You can incorporate information from last years results, weighted by a factor, into the prior distribution using method = "factor
in combination with sampleN
and sampleK
. As an example, the code below incorporates the information from a last years results (a sample of 58 transactions in which 0 misstatements were found), weighted by a factor 0.7, into a prior distribution.
prior6 <- auditPrior(confidence = confidence, likelihood = likelihood, expectedError = expectedError,
materiality = materiality, method = "factor", sampleN = 58, sampleK = 0, factor = 0.7)
prior6
## # ------------------------------------------------------------
## # jfa Prior Distribution Summary (Bayesian)
## # ------------------------------------------------------------
## # Input:
## #
## # Confidence: 95%
## # Expected sample errors: 0%
## # Likelihood: binomial
## # Specifics: Earlier sample of 58 transactions with 0 errors weighted by 0.7
## # ------------------------------------------------------------
## # Output:
## #
## # Prior distribution: beta(α = 1, β = 41.6)
## # Implicit sample size: 40.6
## # Implicit errors: 0
## # ------------------------------------------------------------
## # Statistics:
## #
## # Upper bound: 0.07
## # Precision: 0.07
## # Mode: 0
## # Mean: 0.02
## # Median: 0.02
## # ------------------------------------------------------------
You can visually inspect the prior distribution using the plot()
function.
plot(prior6)
To illustrate how the prior distribution can facilitate a more efficient audit, the table below lists the required sample sizes for the created priors after calling planning(confidence = confidence, expectedError = expectedError, likelihood = likelihood, materiality = materiality, prior = X)
, where X
is the object returned by the auditPrior()
function.
none | arm | median | hypotheses | sample | factor | |
---|---|---|---|---|---|---|
Required sample size | 58 | 46 | 45 | 41 | 28 | 17 |