Package 'audit'

Title: Bounds for Accounting Populations
Description: Find an upper bound for the total amount of overstatement of assets in a set of accounts, or estimate the amount of sales tax owed on a collection of transactions (Meeden and Sargent, 2007, <doi:10.1080/03610920701386802>).
Authors: Glen Meeden <[email protected]>.
Maintainer: Glen Meeden <[email protected]>
License: MIT + file LICENSE
Version: 0.1-2
Built: 2024-11-09 06:33:25 UTC
Source: CRAN

Help Index


Simulating the Total Error in the Accounts

Description

In a population of accounts each unit has a book value, y, (known) and a true but unknown value, x. For a random sample of accounts the true values are observed. Using the posterior from a stepwise Bayes model this simulates possible values of D, the sum of the differences between the the book values and the true values. The 0.95 quantile of this posterior will yield an approximate 95 upper confidence bound for T for most populations and will be less conservative than the Stringer bound.

Usage

simulateD(ysmp,xsmp,yunsmp ,n,pgt,pwa,R)

Arguments

ysmp

numeric vector of book values for the units in the sample

xsmp

the corresponding true values for the units in the sample

yunsmp

numeric vector of the book values for the units not in the sample

n

an integer which is the size of the sample

pgt

numeric vector of prior guesses for the taints

pwa

weights corresponding to the taints that appear in the posterior

R

an integer which is the number of simulated values of D returned

Details

For a given unit (y-x)/x is its taint. pgt is a prior guess for the possible taints in the population. pwt specifies how much weight the prior guess pgt should have in the posterior. When all the taints are assumed to be nonnegative then the Stringer bound is often used. Setting both pqt and pwt equal to one yields a slightly shorter bound than that of Stringer's.

Value

A vector of lenght R containing simulated values of D

References

Meeden, G. and Sargent, D. (2007) Some Bayesian methods for two auditing problems. Communications in Statistics — Theory and Methods, 36, 2727–2740. doi:10.1080/03610920701386802.

Examples

y <- rgamma(500,5)
x <- y
dum <- sample(1:500,50)
x[dum] <- x[dum]*runif(50,.05,0.5)
smp <- sample(1:500,40)
quantile(simulateD(y[smp],x[smp],y[-smp],40,1,1,1000),0.95)

Simulating the Total Number of Accounts in Error

Description

Considered a stratified finite population of accounts where each account is classified as either acceptable or in error. Based on a stratified random sample of accounts an auditor is required to give an upper 95 the population that are in error. Given the sample this uses the posterior distribution from a simple hierarchical Bayes model to simulate possible values for T. The 0.95 quantile for this posterior will be an approximate 95 populations.

Usage

simulateT(smp,n,N,grd,R)

Arguments

smp

numeric vector of the number of accounts in error in each strata in the sample

n

numeric vector of the number of accounts sampled in each strata in the population

N

numeric vector of the total number of accounts in each strata in the population

grd

numeric vector of values usually taken to be seq(0.0001,0.1499,length = 11)

R

an integer which is the number of simulated values of T returned

Value

A vector of length R containing simulated values of T

References

Meeden, G. and Sargent, D. (2007) Some Bayesian methods for two auditing problems. Communications in Statistics — Theory and Methods, 36, 2727–2740. doi:10.1080/03610920701386802.

Examples

grd <- seq(0.0001,0.15,length = 11)
smp <- c(2,1,0)
n <- c(75,50,25)
N <- c(5000,3000,2000)
as.numeric(quantile(simulateT(smp,n,N,grd,40000),0.95))