Learn R Programming

npcp (version 0.2-6)

selectPoints: A point selection procedure for multivariate data

Description

Returns a matrix of `representative' points.

Usage

selectPoints(x, r, kappa = 1.5, plot = FALSE)

Value

a matrix with d columns whose rows are the selected points.

Arguments

x

a numeric matrix with d columns whose rows represent multivariate observations.

r

integer specifying the size of an initial uniformly-spaced grid `on the probability scale'; an upper bound for the number of selected points is r^d.

kappa

numeric constant required to be strictly greater than one involved in the point selection procedure.

plot

logical used only if d = 2 specifying whether a plot should be produced.

Details

The selection procedure is described in detail in Section 3.2 of the reference below. Set plot = TRUE for visual feedback and information on the minimum number of `surrounding' observations required for a grid point to be selected. The initial grid `on the probability scale' is in blue, while the points selected by the procedure are in red.

References

M. Holmes, I. Kojadinovic, and A. Verhoijsen, Multi-purpose open-end monitoring procedures for multivariate observations based on the empirical distribution function, 45 pages, https://arxiv.org/abs/2201.10311.

See Also

selectPoints() is used in detOpenEndCpDist().

Examples

Run this code
## Generate data
set.seed(123)
x1 <- rnorm(1000, 0, 1)
x2 <- rnorm(1000, 0.7 * x1, sqrt((1 - 0.7^2)))
x <- cbind(x1, x2)

## Point selection
selectPoints(x, r = 3, kappa = 1.5, plot = TRUE)
selectPoints(x, r = 3, kappa = 4, plot = TRUE)

selectPoints(x, r = 5, kappa = 1.5, plot = TRUE)
selectPoints(x, r = 5, kappa = 4, plot = TRUE)

Run the code above in your browser using DataLab