plot-bard.sampler.class {anomaly}R Documentation

Visualisation of data, collective and point anomalies.

Description

Plot methods for S4 objects returned by capa, capa.uv, capa.mv, scapa.uv, scapa.mv, pass, and sampler.

The plot can either be a line plot or a tile plot, the type produced depending on the options provided to the plot function and/or the dimensions of the data associated with the S4 object.

Usage

## S4 method for signature 'bard.sampler.class'
plot(x, subset, variate_names, tile_plot, marginals = FALSE)

## S4 method for signature 'capa.class'
plot(x, subset, variate_names = FALSE, tile_plot, epoch = nrow(x@data))

## S4 method for signature 'capa.mv.class'
plot(x, subset, variate_names = FALSE, tile_plot)

## S4 method for signature 'capa.uv.class'
plot(x, variate_name = FALSE)

## S4 method for signature 'pass.class'
plot(x, subset, variate_names = FALSE, tile_plot)

## S4 method for signature 'scapa.mv.class'
plot(x, subset, variate_names = FALSE, tile_plot, epoch)

## S4 method for signature 'scapa.uv.class'
plot(x, epoch, variate_name = FALSE)

Arguments

x

An instance of an S4 class produced by capa, capa.uv, capa.mv, pass, or sampler.

subset

A numeric vector specifying a subset of the variates to be displayed. Default value is all of the variates present in the data.

variate_names

Logical value indicating if variate names should be displayed on the plot. This is useful when a large number of variates are being displayed as it makes the visualisation easier to interpret. Default value is FALSE.

tile_plot

Logical value. If TRUE then a tile plot of the data is produced. The data displayed in the tile plot is normalised to values in [0,1] for each variate. This type of plot is useful when the data contains are large number of variates. The default value is TRUE if the number of variates is greater than 20.

marginals

Logical value. If marginals=TRUE the plot will include visualisations of the marginal probablities of each time point being anomalous. The defualt is marginals=FALSE.

epoch

Positive integer. CAPA methods are sequential and as such, can generate results up to, and including, any epoch within the data series. This can be controlled by the value of epoch and is useful for examining how the inferred anomalies are modified as the data series grows. The default value for epoch is the length of the data series.

variate_name

Logical value indicating if the variate name should be displayed. Default value is variate_name=FALSE.

Value

A ggplot object.

See Also

capa,capa.uv,capa.mv,pass,sampler.


[Package anomaly version 4.0.1 Index]