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 |
newdata |
a |
rda_params |
a |
transform |
Logical indicating if the supplied p-values should be transformed by the function |
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)