cECM_decision {ezECM} | R Documentation |
Decision Function for the C-ECM Model
Description
Returns category decisions for uncategorized events. When the true category of such events are known performance metrics are returned.
Usage
cECM_decision(pval = NULL, alphatilde = NULL, vic = NULL, cat_truth = NULL)
Arguments
pval |
Class |
alphatilde |
Scalar numeric between 0 and 1, used as the significance level for hypothesis testing. |
vic |
Character vector of length one, indicating the Very Important Category (VIC). Used for judging accuracy, false negatives, and false positives for binary categorization. Required when |
cat_truth |
Character vector corresponding to the true group of each row in the |
Details
When is.null(cat_truth) == TRUE
, categorization over all event categories is used, using the same framework seen in (Anderson et al. 2007). The return value of "indeterminant"
happens when there is a failure to reject multiple event categories. "undefined"
is returned when all event categories are rejected.
When the arguments cat_truth
and vic
are included, binary categorization is utilized instead of categorization over all training categories. The definition of accuracy is more ambiguous when categorizing over all training categories and the user is encouraged to develop their own code for such a case. The goal of binary categorization is to estimate if an uncategorized observation is or is not in the event category stipulated by vic
. Uncategorized events which are "indeterminant"
or "undefined"
are deemed to not be in the vic
category.
Value
When is.null(cat_truth) == TRUE
a vector providing the categorization over all event categories is returned. When the cat_truth
and vic
arguments are supplied a list is returned containing a data.frame
detailing if each event was categorized accurately in a binary categorization framework, was a false positive, was a false negative, and the estimated event category. A vector stating overall categorization accuracy, false positive rate, and false negative rate is included with the list.
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.
Examples
file_path <- system.file("extdata", "good_training.csv", package = "ezECM")
training_data <- import_pvals(file = file_path, header = TRUE, sep = ",", training = TRUE)
newdata <- training_data[1:10,]
cat_truth <- newdata$event
newdata$event <- NULL
training_data <- training_data[-(1:10),]
pval <- cECM(training_data, transform = TRUE, newdata = newdata)
binary_decision <- cECM_decision(pval = pval, alphatilde = 0.05,
vic = "explosion", cat_truth = cat_truth)
decision <- cECM_decision(pval = pval, alphatilde = 0.05)