New features
- @federicapicogna added
fairness_selection()
to aid in the decision between fairness metrics. The function has an accompanyingprint()
andplot()
method. - @lottemensink added
plot(x, type = "sequential")
to theevaluation()
function when used withprior
,materiality
anddata
. The plot shows Bayes factors as a function of the sample size.
Bug fixes
- Fixed a bug in the
evaluation()
function usingmethod = "hypergeometric"
where the user could provide broken taints. These taints are now rounded to the nearest integer value.
Minor changes
- In the
auditPrior()
function,method = "factor"
has been replaced withmethod = "power"
to be consistent with existing terminology. selection()
now always performs sampling with replacement when usingitems = "values"
andmethod = "random"
(Thanks to @lottemensink for the suggestion). This should not lead to substantial differences in typical audit populations.
New features
- Added the option to calculate a frequentist multi-stage sampling plan with the
planning()
function. This can be done by providing a vector of integers to theexpected
argument that specifies the intended sampling plan. For instance,expected = c(1, 0)
gives the sample size for a two-stage sampling plan in which the auditor is allowed to extend the initial sample after finding one misstatement and is allowed to approve the population if the initial sample contains no misstatements. - Added inflated methods to evaluate taintings in the evaluation function via
method = "inflated.poisson"
andmethod = "hurdle.beta"
. Since these methods rely on mcmc sampling, they can take any form of prior. They can also be fitted using maximum likelihood estimation withprior = FALSE
.
Minor changes
- For all plotting functions,
type = "estimates"
is now the default option.
Major changes
- Removed the
report()
function as it did not align with the rest of the functionality in the package.
Bug fixes
- Fixed a bug in
selection()
where the numeric data in the sample was returned as character if the original data was entered as character only (i.e.,selection(data.frame(x = c("hello", "bye", "hi")), size = 2)
). N.units
is now only taken from the prior if the user does not provide it manually to theplanning()
andevaluation()
functions.
New features
- Added a new function
model_fairness()
to compute fairness metrics for algorithm auditing on the basis of predictions of an algorithm.
Minor changes
- In the
evaluation()
function, the typical stringer bound has been changed frommethod = "stringer"
tomethod = "stringer.binomial"
. Furthermore, additional methodsstringer.poisson
andstringer.hypergeometric
are added that apply the stringer bound using the Poisson and hypergeometric distributions, respectively. Thestringer
method will remain for now but redirect tostringer.binomial
. - Compatibility with
rstantools 2.3.1
.
New features
digit_test()
function now returns elementestimates
containing observed proportions and their corresponding confidence intervals. The plot output also shows these intervals around the estimates.
Bug fixes
- Changed the links to the images in the vignettes from absolute links to GitHub to relative links as to avoid problems with GitHub servers being unavailable in the future.
New features
- Additional possibilities to create, plan and evaluate using nonparametric prior distributions.
- Added functionality for stratified evaluation in the
evaluation()
function. - Integrated the auditing functionality of the
digitTests
package via thedigit_test()
andrepeated_test()
functions.
Bug fixes
- Fixed a bug where the proportion of value in
summary(selection)
was displayed incorrectly.
Minor changes
- Improved the error handling and error messages.
Minor changes
- Resolved CRAN note
Warning: <img> attribute "align" not allowed for HTML5
. - Improve compatibility with
R 4.2.0
.
Minor changes
- The value for
x
inevaluation()
andexpected
inplanning()
is now automatically ceiled (while throwing a warning) formethod = "hypergeometric"
. - Improved overall documentation.
Major changes
- Removed the output and functions related to the class
jfaPredictive
. The probabilities for the prior and posterior predictive distributions can be obtained by calling thepredict()
function.
Minor changes
- The value for
N.units
inauditPrior()
,planning()
, andevaluation()
is now automatically ceiled forlikelihood
/method
='hypergeometric'
. - Implemented a warning message when the
likelihood
in theprior
does not match with thelikelihood
/method
inputs forplanning()
andevaluation()
. The likelihood from the prior is leading in these cases and will overrule the other options.
New features
- Added argument
randomize
to theselection()
function, which allows the user to randomly shuffle the items in the population before selection. Note that specifyingrandomize = TRUE
overrulesorder
.
Bug fixes
- Fixed a bug where the maximum sample size was not reached (i.e.,
planning
stopped atmax
- 1).
Major changes
- The
order
argument inselection()
no longer accepts a logical, but instead takes the column name of the ranking variable in thedata
.
Minor changes
- Adjusted an error in the text of the selection vignette.
- Rewritten most of the vignettes.
New features
- Added argument
alternative
with possible optionsless
(default),two.sided
, andgreater
to theevaluation()
function that allows control over the type of hypothesis test to perform and the type of confidence / credible interval to calculate. - Added
predict.jfaPrior()
andpredict.jfaPosterior()
that produce predictions for the data under the prior or posterior distribution. - Added
method = 'param'
to functionauditPrior()
which takes as input the rawalpha
andbeta
parameters of the prior distribution. - Added
method = 'strict'
to functionauditPrior()
which constructs an (improper) prior distribution that yields the same results (with respect to sample sizes and upper limits) as classical procedures. - Added the modified seed sampling algorithm (
method = 'sieve')
toselection()
. - Added a new vignette that describes the sampling methodology implemented in
jfa
. - objects from
auditPrior()
,planning()
, andevaluation()
now contain information about the posterior predictive distribution whenN.units
is specified.
Major changes
- From
jfa
0.5.7 tojfa
0.6.0 there has been a major overhaul in the names of function arguments. This is done so that the calls integrate better with general R syntax and the package gets more user-friendly. I apologize for any inconvenience this may cause. The following names have been changed:median
->impartial
(inauditPrior()
)sampleK
->x
(inauditPrior()
)sampleN
->n
(inauditPrior()
)N
->N.units
(inauditPrior()
)maxSize
->max
(inplanning()
)increase
->by
(inplanning()
)withReplacement
->replace
(inselection()
)ordered
->order
(inselection()
)ascending
->decreasing
(inselection()
)intervalStartingPoint
->start
(inselection()
)algorithm
->method
(inselection()
)expectedErrors
->expected
(inauditPrior()
andplanning()
)confidence
->conf.level
(inauditPrior()
,planning()
, andevaluation()
)pHmin
->p.hmin
(inauditPrior()
)minPrecision
->min.precision
(inauditPrior()
,planning()
, andevaluation()
)population
->data
(inselection()
)kSumstats
->x
(inevaluation()
)nSumstats
->n
(inevaluation()
)sample
->data
(inevaluation()
)bookValues
->values
(inselection()
andevaluation()
)auditValues
->values.audit
(inevaluation()
)counts
->times
(inevaluation()
)popBookValues
->N.units
(inevaluation()
)rohrbachDelta
->r.delta
(inevaluation()
)momentPopType
->m.type
(inevaluation()
)csA
->cs.a
(inevaluation()
)csB
->cs.b
(inevaluation()
)csMu
->cs.mu
(inevaluation()
)records
->items
(inselection()
)mus
->values
(inselection()
)hypotheses
->hyp
(inauditPrior()
)
poisson
is now the default likelihood / method for all functions since it is the most conservative.method = 'interval'
is now the default selection method.- The default prior distributions used when
method = 'default'
orprior = TRUE
are now set to thegamma(1, 1)
,beta(1,1)
, andbeta-binomial(1, 1)
priors. - The
times
(formercounts
) argument inevaluation()
must now be indicated as a column name in thedata
instead of a vector. nPrior
andkPrior
have been removed from theplanning()
andevaluation()
functions. All prior distributions must now be specified usingprior = TRUE
(noninformative priors) or using a call toauditPrior()
.- Removed the
auditBF()
function since its value is available throughevaluation(materiality = x, prior = auditPrior(method = 'impartial', materiality = x))
Minor changes
- It is now allowed for
x
andn
to have the same value inevaluation()
. - The parameters for an impartial beta-binomial prior are now calculated more efficiently in the case of zero expected errors.
Minor changes
- The logo is now displayed in the
?jfa-package
help file. - The cheat sheet link has changed in the README file.
Bug fixes
- Fixed a bug in the
print.jfaEvaluation()
call if there was no performance materiality specified andprior = TRUE
.
New features
- The
print()
functions now return a more concise description of the relevant output. - Added
summary()
functions for all returned objects that take over the former (elaborate) output of theprint()
functions. - Implemented a new function
auditBF()
which computes Bayes factors from summary statistics of an audit sample.
Bug fixes
- Fixed a bug in
evaluation()
in which the likelihood stored in the prior was not properly passed to the function. - Fixed an error in the calculation of the posterior mode of the beta distribution.
Minor changes
- Restored the default value (0.95) for the 'confidence' argument in all applicable functions.
New features
- Objects with class
jfaPosterior
as returned byevaluation()$posterior
andplanning()$expectedPosterior
can now be used as input for theprior
argument in theplanning()
andevaluation()
functions.
Bug fixes
- Fixed a bug in
method = 'bram'
in theauditPrior()
function where the prior parameters would go off to infinity whenexpectedError = 0
.
Major changes
- Now calculates the upper bound for the population errors according to the hypergeometric distribution via an inverted hypothesis test. As a result of this method, the
planning()
function does not require a value for themateriality
anymore when planning with thehypergeometric
likelihood.
Minor changes
- Added a benchmark for the
MUS
package to the unit tests. - Improved plots with better titles and axes labels.
New features
- Made
expectedErrors > 0
available formethod = 'hypotheses'
in theauditPrior()
function. - Made
method = 'hypotheses'
andmethod = 'impartial'
in theauditPrior()
function available forlikelihood = 'hypergeometric'
. - Added
bram
as a method for theauditPrior()
function.method = 'bram'
computes a prior distribution with a given mode (expectedError
) and upper bound (ub
).
Bug fixes
- Fixed an error in the mode of the gamma posterior distribution from the
evaluation()
function in which+1
was added to the beta parameter, resulting in slightly lower modes than the correct ones. - Made a correction to the calculation of the beta-binomial prior and posterior so that the posterior parameter
N
has the correct value ofN = N - n
(current) instead ofN - n + k
(before).
Major changes
- Removed the default value
confidence = 0.95
in all applicable functions.confidence
currently has no default value so that the user is required to give an input. - Changed the default
likelihood = 'poisson'
in theplanning()
function tolikelihood = 'binomial'
to be consistent across all functions. - Changed the order of most function arguments so that
materiality
andminPrecision
are among the first ones to be shown.
Minor changes
- Updated the documentation for all functions with more simple examples.
New features
- Update the poisson evaluation calculation so that it allows for fractional errors.
Bug fixes
- Fixed an error in the hypergeometric upper bound calculation that was accidentally based on the
phyper()
function instead of theqhyper()
function, which resulted in lower bounds than usual.
Minor changes
- Add statistical tables with output (sample sizes, upper limits, Bayes factors) to the GitHub repository in pdf format.
- Changed the computation method of the sample sizes for hypergeometric and beta-binomial distributions so that they are faster.
Bug fixes
- Reduced the size of the tarball by adding files to the .Rbuildignore
- Fixed a bug in
selection()
where ifpopulation
is sorted or modified,bv
still retained the old ordering and data. The resulting sample was overweighted towards small values and/or still contained negative values (Thanks to @alvanson).
New features
- Add a function
report()
that automatically generates an audit report.
Major changes
- Removed the
sampling()
function, which is now replaced entirely with theselection()
function. - Changed the output of the
evaluation()
function when an estimator is used.
New features
- Added
digits
argument in the internaljfa:::print.jfaPrior()
,jfa:::print.jfaPlanning()
,jfa:::print.jfaSelection()
, andjfa:::print.jfaEvaluation()
functions to control rounding in printing. - Added
description
,statistics
,specifics
andhypotheses
to the output of theauditPrior()
function. - Added class
jfaPosterior
withprint()
andplot()
methods. - Added
expectedPosterior
of classjfaPosterior
to the output of theplanning()
function, includesdescription
,statistics
andhypotheses
. - Added
posterior
of classjfaPosterior
to the output of theevaluation()
function, includesdescription
,statistics
andhypotheses
.
Bug fixes
- Implemented improved calculation of prior parameters in the
auditPrior()
function formethod = impartial
whenexpectedErrors > 0
.
Major changes
- Add a warning message to the
sampling()
function that it will be deprecated from 0.5.0 onward. You can useselection()
instead, sincesampling()
causes namespace issues with other packages.
Minor changes
- Changed the class
jfaSampling
tojfaSelection
. This should not have any consequences.
Bug fixes
- Fixed a bug in the
planning()
function that did not allow the user to plan for a monetary sample when their population size was too low. - Fixed a bug in the
planning()
function that did not allow the user to select a non-integer number of expected errors when there was a prior involved.
Minor changes
- Added unit tests that regularly verify results of the
planning()
andevaluation()
functions against benchmarks.
New features
- Implemented the argument
counts
in theevaluation()
function that quantifies how many times each observation should be evaluated due to being selected multiple times in the selection stage.
New features
- Implemented prior construction methods
default
,impartial
,hypotheses
,sample
, andfactor
in theauditPrior()
function. In addition to the already supportedarm
method, these methods allow the auditor to incorporate more sources of audit information into the prior distribution. - Implemented
minPrecision
argument in theplanning()
function that allows auditors to calculate a sample size so that the difference between the posterior upper confidence bound and the most likely error is lower than the set minimum precision. Also implemented in theevaluation()
function as a requirement to approve the population. - Return the value
mle
from theevaluation()
function, which quantifies the most likely error. Also return the value of theprecision
from this function. - Implemented
increase
argument in theplanning()
function that allows the user to increase the sample size with a set amount each step of the iterations.
Minor changes
- Implemented more efficient versions of the monetary unit sampling algorithms.
- Changed the x-axis labels in the default plot to theta instead of misstatement.
New features
- First version of the
jfa
package. The package provides four functions:auditPrior()
,planning()
,sampling()
, andevaluation()
.