ftest.calibrate: Calibrating 'ftest' for ABC

Description Usage Arguments Value Note References See Also Examples

Description

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:

  1. (what = ALPHA) compute the ABC false positive rate for given critical region,

  2. (what = CR) calibrate the critical region for given ABC false positive rate,

  3. (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).

Usage

1
2
3
4
ftest.calibrate(n.of.x = NA, t2.x = NA, n.of.y = NA, p = NA,
  what = "MXPW", mx.pw = 0.9, alpha = 0.01, c = NA, tau = NA,
  tol = 1e-05, max.it = 100, pow_scale = 1.5, use.R = FALSE,
  debug = FALSE, plot = FALSE, verbose = FALSE)

Arguments

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

Value

vector

Note

  1. (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.

  2. (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].

  3. (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).

References

http://arxiv.org/abs/1305.4283

See Also

mutost.calibrate, vartest.calibrate, ratetest.calibrate, ztest.calibrate

Examples

 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) })

olli0601/abc.star documentation built on May 24, 2019, 12:53 p.m.