Description Usage Arguments Value Note References See Also Examples
Calibrate the one-sample equivalence test for population means of multivariate normal summary values with unknown population covariance matrix for ABC inference.
Different types of calibrations are available, see Notes for details:
(what = ALPHA
) compute the ABC false positive rate for given critical region,
(what = CR
) calibrate the critical region for given ABC false positive rate,
(what = MXPW
) calibrate the critical region and the equivalence region for given ABC false positive rate and maximum power.
Depending on the type of calibration, some of the following inputs must be specified (see Examples).
1 2 3 4 |
p |
Number of variables |
what |
Character string to indicate the type of calibration to be performed |
mx.pw |
Maximum power at the point of equality |
alpha |
Level of the equivalence test |
c |
Upper boundary point of the critical region |
tau |
Upper boundary point of the equivalence region |
tol |
Required error tolerance in calibrating the actual maximum power to the requested maximum power |
max.it |
Maximum number of optimization steps at each calibration hierarchy |
pow_scale |
Scale for the support of the power function (used for plotting) |
plot |
Flag to plot calibrations |
verbose |
Flag to run in verbose mode |
n |
Number of replicate simulations |
vector
(what = ALPHA
) This calibration requires the inputs c
, tau
with 0 < tau
and c > 0
.
The output contains the corresponding ABC false positive rate alpha
.
This option does not specify any of the free ABC parameters, but may be useful to determine the ABC
false positive rate for uncalibrated ABC routines.
(what = CR
) This calibration requires the input tau
, alpha
with tau > 0
and default alpha = 0.01
.
The output contains the corresponding critical value c
, which defines critical region [0, c]
, which corresponds to the ABC tolerance region typically denoted by [0, tau]
.
(what=MXPW
) This calibration requires the inputs alpha
, mx.pw
, with default values 0.01 and 0.9 respectively.
The output contains the corresponding critical value c
, corresponding to critical region [0, c]
(to be used in ABC). It also contains
the corresponding squared distance tau
, defining equivalence region [0, tau]
that gives a suitable ABC accept/reject probability if the simulated summary values are close to the observed summary values.
As a check to the numerical calibrations, the actual power at the point of equality is returned (pw.cmx
).
http://arxiv.org/abs/1305.4283
mutost.calibrate
, vartest.calibrate
, ratetest.calibrate
, ztest.calibrate
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | # calibrating the F-test
# set number of variables (i.e. summary statistics)
p <- 3
# set number of observations
n.of.x <- 100
# set number of simulations
n.of.y <- 100
# set T2 calculated on the observed data
t2.x <- 0.25
# Example 1: calculate ABC false positive rate for given ABC tolerance
# this requires to specify c, tau2 (ad-hoc ABC parameters), n (the number of
# simulated data sets) and p (the number of dimensions)
# note: can be useful to compute the ABC false positive rate for uncalibrated ABC routines
ftest.calibrate(n.of.y=n.of.y, p=p, what = 'ALPHA', c = 6.5, tau = 0.21, plot = TRUE)
# Example 2: calibrate critical region for given ABC false positive rate and equivalence region
# this requires to specify alpha (calibration parameters), tau2 (ad-hoc ABC parameter),
# n (the number of simulated data sets) and p (the number of dimensions)
# note: this is just an intermediate calibration and may result in unsuitable power properties
ftest.calibrate(n.of.y=n.of.y, p=p, what = 'CR', tau = 0.21, alpha = 0.01, plot = TRUE)
# Example 3: calibrate critical region and power of ABC accept/reject step
# this requires to specify alpha, mx.pw (calibration parameters), n (the number of
# simulated data sets) and p (the number of dimensions)
# note: this is just an intermediate calibration and may result in unsuitable power properties
ftest.calibrate(n.of.y=n.of.y, p=p, what = 'MXPW', mx.pw = 0.9, alpha = 0.01, use.R= TRUE, plot = TRUE)
ftest.calibrate(n.of.y=n.of.y, p=p, what = 'MXPW', mx.pw = 0.9, alpha = 0.01, use.R= FALSE, plot = TRUE)
# Example 4: calibrate critical region, power of ABC accept/reject step, and #simulated data points
# this requires to specify alpha, mx.pw (calibration parameters), and n.of.x, t2.of.x (summary parameters)
# note: this is the default calibration
ftest.calibrate(n.of.x=n.of.x, t2.x=t2.x, p=p, what='KL', mx.pw=0.9, alpha=0.01, use.R= TRUE, plot=TRUE)
ftest.calibrate(n.of.x=n.of.x, t2.x=t2.x, p=p, what='KL', mx.pw=0.9, alpha=0.01, use.R= FALSE, plot=TRUE)
system.time({ for(i in 1:1e4) ftest.calibrate(n.of.x=n.of.x, t2.x=t2.x, p=p, what='KL', mx.pw=0.9, alpha=0.01, use.R= FALSE) })
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.