fastSTB: Simultaneous Tolerance Bands Using a Fast C-Implementation.

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/stb.R

Description

This function represents the interface to a C-implementation of the bisection algorithm for computing simultaneous tolerance bounds as described in Schuetzenmeister et al. 2012.

Usage

1
2
3
4
5
6
7
8
fastSTB(
  mat,
  alpha = 0.05,
  tol = 1e-04,
  max.iter = 100L,
  Ncpu = 2,
  timer = FALSE
)

Arguments

mat

(numeric) matrix with rows representing simulations of 'ncol' values, rows are supposed to be sorted

alpha

(numeric) 100(1-alpha)% simultaneous tolerance level (coverage)

tol

(numeric) convergence tolerance level for the bisection algorithm

max.iter

(integer) number of bisection-steps for the algorithm

Ncpu

(integer) specifying the number of processors (CPUs, cores, ...) to be used

timer

(logical) TRUE = the time spent for computing the STB will be printed

Details

Quantiles will be computed according to SAS PCTLDEF5 definition of quantiles, which is identical to 'type=2' in function quantile. This is also the default-option throughout this package. Function SASquantile is a R-implementation identical to the C-implementation used here.

Value

(list) with elements:

mat

(numeric) matrix with sorted random vector stored in rows

nCol

(integer) number of columns of 'mat'

nRow

(integer) number of rows of 'mat'

alpha

(numeric) values used for the 100(1-alpha)% STB

tol

(numeric) the tolerance value used as stopping criterion for the bisection algorithm

max.iter

(integer) the max. number of iteration of the bisection algorithm

Q

(numeric) matrix with 2 rows, corresponding to the bounds of the STB (1st row = lower bounds, 2nd row = upper bounds)

coverage

(numeric) value corresponding to the actual coverage of the STB

Author(s)

Andre Schuetzenmeister andre.schuetzenmeister@roche.com

References

Schuetzenmeister, A., Jensen, U., Piepho, H.P. (2011), Checking assumptions of normality and homoscedasticity in the general linear model. Communications in Statistics - Simulation and Computation; S. 141-154

See Also

getSTB stb

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
### example for 10000 x 30 matrix
 set.seed(333)
 mat <- t(apply(matrix(rnorm(10000*30), ncol=30), 1, sort))
 stb.obj1 <- fastSTB(mat, timer=TRUE)
 stb.obj1$coverage
	stb.obj2 <- fastSTB(mat, timer=TRUE, Ncpu=4)
 stb.obj3 <- fastSTB(mat, timer=TRUE, Ncpu=6)
 stb.obj4 <- fastSTB(mat, timer=TRUE, Ncpu=8)

## End(Not run)

STB documentation built on Sept. 15, 2021, 5:07 p.m.

Related to fastSTB in STB...