calcDepth_asymp: Calculating the K-sign depth (asymptotically)

Description Usage Arguments Value Note References Examples

View source: R/calcDepth_asymp.R

Description

calcDepth_asymp calculates the K-sign depth of a given vector of residuals (asymptotically).

Usage

1
calcDepth_asymp(res, K, transform = FALSE, exact = TRUE)

Arguments

res

[numeric]
numeric vector of residuals

K

[integer(1)]
the parameter K for the sign depth

transform

[logical(1)]
Should the depth be transformed by the formula N * (res - 0.5^(K-1)), so that the distribution of the K-sign depth converges for large number of data points N? Default is FALSE.

exact

[logical(1)]
Should the depth be calculated exactly? If FALSE, terms of scale o(1) will ne ignored. At the moment, for exact results this method is available only for K = 2, 3, 4, 5. Default is TRUE.

Value

[numeric(1)] the calculated K-sign depth of res.

Note

The implementation is based on a work of Dennis Malcherczyk.

References

Malcherczyk, D. (2021+). K-sign depth: Asymptotic distribution, efficient computation and applications. Dissertation in preparation.

Examples

1
2
3
calcDepth_asymp(rnorm(10), 3)
calcDepth_asymp(runif(100, -1, 1), 4, transform = TRUE)
calcDepth_asymp(runif(100, -1, 1), 4, transform = TRUE, exact = FALSE)

melaniehorn/GSignTest documentation built on July 11, 2021, 1:18 a.m.