plot.cECM {ezECM}R Documentation

Plot the data and output of cECM() categorization

Description

Plot the data and output of cECM() categorization

Usage

## S3 method for class 'cECM'
plot(x, discriminants = c(1, 2), thenull = NULL, alphatilde = 0.05, ...)

Arguments

x

an object of which is of class "cECM", retrieved from the output of the cECM() function. The "cECM" object may or may not contain unlabeled data.

discriminants

character or integer vector of length two. If a character vector is provided, the character strings must match a subset of the column names for the training data, ie. all(discriminants %in% names(x$x)) must be true. If an integer vector is given, the elements of the vector select the column indices of the data to be plotted.

thenull

character string or NULL. When unlabeled data is found within an "cECM" object, the name of one of the event categories can be provided as this argument. When "thenull" is provided, unlabled data where the category hypothesis is rejected is colored red.

alphatilde

numeric value specifying hypothesis testing significance level. Used in conjunction with thenull, aggregate p-values less than alphatilde are rejected and colored accordingly.

...

arguments passed to base::plot()

Details

The plot generated from plot.ecm() is first dependent on if the provided x$newdata contains a data frame of unlabled data.

If unlabled data is not part of the "cECM" object, the labled data is simply plotted with the 0.68 and 0.95 confidence levels obtained from the distribution fits returned from cECM().

If unlabled data is part of the "cECM" object, the unlabled data is plotted in addition to the distribution plots. Each unlabled data point appears on the plot as an integer, which indexes the corresponding row of x$newdata.

Value

Plot illustrating results of cECM()

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)

plot(x = pval_cat, thenull = "explosion")


[Package ezECM version 1.0.0 Index]