# NOT RUN {
library(jfa)
# Specify the materiality, confidence, and expected errors:
materiality <- 0.05 # 5%
confidence <- 0.95 # 95%
expectedError <- 0.025 # 2.5%
# Specify the inherent risk (ir) and control risk (cr):
ir <- 1 # 100%
cr <- 0.6 # 60%
# Create a beta prior distribution according to the Audit Risk Model (arm)
# and a binomial likelihood:
prior <- auditPrior(confidence = confidence, likelihood = "binomial",
method = "arm", expectedError = expectedError, materiality = materiality,
ir = ir, cr = cr)
print(prior)
# ------------------------------------------------------------
# jfa Prior Distribution Summary (Bayesian)
# ------------------------------------------------------------
# Input:
#
# Confidence: 0.95
# Expected sample errors: 0.02
# Likelihood: binomial
# Specifics: Inherent risk = 1; Internal control risk = 0.6; Detection risk = 0.08
# ------------------------------------------------------------
# Output:
#
# Prior distribution: beta(2.275, 50.725)
# Implicit sample size: 51
# Implicit errors: 1.27
# ------------------------------------------------------------
# Statistics:
#
# Upper bound: 0.1
# Precision: 7.1%
# Mode: 0.02
# Mean: 0.04
# Median: 0.04
# ------------------------------------------------------------
# }
Run the code above in your browser using DataLab