cECM {ezECM}R Documentation

Multiple Discriminant Analysis

Description

Fits a regularized discriminant analysis model to labeled training data and generates an aggregate p-value for categorizing newly obtained data.

Usage

cECM(x, newdata = NULL, rda_params = NULL, transform = TRUE)

Arguments

x

Either a data.frame of training data or the list output from previous use of the cECM function. If a data.frame is supplied, each row contains one point of training data. Additionally, one column, with the name of event, must contain labels for the event of each row. The remaining columns contain the observed ncol(x) - 1 discriminant related p-value data.

newdata

a data.frame containing new data for event categorization. Must use a subset of the discriminants used in the training data. If for a particular event a certain discriminant is unavailable, specifying NA in place of the p-value will allow for calculation of the aggregate p-value.

rda_params

a list of arguments passed to the klaR::rda() function. If arguments rda_params$x or rda_params$grouping are supplied, they are ignored.

transform

Logical indicating if the supplied p-values should be transformed by the function 2/\pi \times \mathrm{asin}\sqrt{X}. Ignored if a list is supplied as the argument x.

Details

Details on regularized discriminant analysis (RDA) can be found in Friedman (1989). Details on related implementation found in Anderson et al. (2007).

Value

A list. Any returned objects contain a list element indicating the value of transform supplied to the cECM function call, as well as a klaR::rda() object related to relevant training data. In addition if newdata argument is supplied, the returned list contains a data.frame specifying aggregate p-values for each new event (rows) for related event category (columns).

References

Anderson DN, Fagan DK, Tinker MA, Kraft GD, Hutchenson KD (2007). “A mathematical statistics formulation of the teleseismic explosion identification problem with multiple discriminants.” Bulletin of the Seismological Society of America, 97(5), 1730–1741.

Friedman JH (1989). “Regularized discriminant analysis.” Journal of the American statistical association, 84(405), 165–175.

Examples


x <- pval_gen(sims = 20, pwave.arrival = list(optim.starts = 5))
s <- sample(1:20, size = 2)

newdata <- x[s,]
newdata <- newdata[,-which(names(newdata) == "event")]

x <- x[-s,]

pval_cat <- cECM(x = x, transform = TRUE)

pval_cat <- cECM(x = pval_cat, newdata = newdata)



[Package ezECM version 1.0.0 Index]