plot.ssMRCD {ssMRCD}R Documentation

Plot Method for ssMRCD Object

Description

Plots diagnostics for function output of ssMRCD regarding convergence behavior and the resulting covariances matrices.

Usage

## S3 method for class 'ssMRCD'
plot(
  x,
  type = c("convergence", "ellipses"),
  centersN = NULL,
  colour_scheme = "none",
  xlim_upper = 9,
  manual_rescale = 1,
  legend = TRUE,
  xlim = NULL,
  ylim = NULL,
  ...
)

Arguments

x

object of class "ssMRCD".

type

type of plot, possible values are "convergence" and "ellipses". See details.

centersN

for plot type "ellipses" a matrix specifying the positions of the centers of the covariance estimation centers, see also geo_weights.

colour_scheme

coloring scheme used for plot type "ellipses", either "trace" or "regularity" or "none".

xlim_upper

numeric giving the upper x limit for plot type "convergence".

manual_rescale

for plot type "ellipses" numeric used to re-scale ellipse sizes.

legend

logical, if color legend should be included.

xlim

vector of xlim (see par).

ylim

vector of ylim (see par).

...

further plotting parameters.

Details

For type = "convergence" a plot is produced displaying the convergence behaviour. Each line represents a different initial value used for the c-step iteration. On the x-axis the iteration step is plotted with the corresponding value of the objective function. Not monotonically lines are plotted in red.

For type = "ellipses" and more than a 2-dimensional data setting plotting the exact tolerance ellipse is not possible anymore. Instead the two eigenvectors with highest eigenvalue from the MCD used on the full data set without neighborhood assignments are taken and used as axis for the tolerance ellipses of the ssMRCD covariance estimators. The tolerance ellipse for the global MCD covariance is plotted in grey in the upper left corner. It is possible to set the colour scheme to "trace" to see the overall amount of variabilty and compare the plotted covariance and the real trace to see how much variance is not plotted. For "regularity" the regularization of each covariance is shown.

Value

Returns plots of the ssMRCD methodology and results.

See Also

ssMRCD, summary.ssMRCD, local_outliers_ssMRCD, plot.locOuts

Examples

# set seed
set.seed(1)

# create data set
data = matrix(rnorm(2000), ncol = 4)
coords = matrix(rnorm(1000), ncol = 2)
N_assignments = sample(1:10, 500, replace = TRUE)
lambda = 0.3

# calculate ssMRCD by using the local outlier detection method
outs = local_outliers_ssMRCD(data = data,
                             coords = coords,
                             N_assignments = N_assignments,
                             lambda = lambda,
                             k = 10)

# plot ssMRCD object included in outs
plot(x = outs$ssMRCD,
     centersN = outs$centersN,
     colour_scheme = "trace",
     legend = FALSE)


[Package ssMRCD version 0.1.0 Index]