CreateOutliersPlot: Functional Principal Component or Functional Singular Value...

View source: R/CreateOutliersPlot.R

CreateOutliersPlotR Documentation

Functional Principal Component or Functional Singular Value Decomposition Scores Plot using 'bagplot' or 'KDE' methodology

Description

This function will create, using the first components scores, a set of convex hulls of the scores based on 'bagplot' or 'KDE' methodology.

Usage

CreateOutliersPlot(fObj, optns = NULL, ...)

Arguments

fObj

A class object returned by FPCA() or FSVD().

optns

A list of options control parameters specified by list(name=value). See ‘Details’.

...

Additional arguments for the 'plot' function.

Details

Available control options are

ifactor

inflation ifactor for the bag-plot defining the loop of bag-plot or multiplying ifactor the KDE pilot bandwidth matrix. (see ?aplpack::compute.bagplot; ?ks::Hpi respectively; default: 2.58; 2 respectively).

variant

string defining the outlier method used ('KDE', 'NN' or 'bagplot') (default: 'KDE')

unimodal

logical specifying if the KDE estimate should be unimodal (default: FALSE, relevant only for variant='KDE')

maxVar

logical specifying if during slicing we should used the directions of maximum variance (default: FALSE for FPCA, TRUE for FSVD)

nSlices

integer between 3 and 16, denoting the number of slices to be used (default: 4, relevant only for groupingType='slice')

showSlices

logical specifying if during slicing we should show the outline of the slice (default: FALSE)

colSpectrum

character vector to be use as input in the 'colorRampPalette' function defining the outliers colours (default: c("red", "yellow", 'blue'), relevant only for groupingType='slice')

groupingType

string specifying if a slice grouping ('slice') or a standard percentile/bagplot grouping ('standard') should be returned (default: 'standard')

fIndices

a two-component vector with the index of the mode of variation to consider (default: c(1,2) for FPCA and c(1,1) for FSVD)

Value

An (temporarily) invisible copy of a list containing the labels associated with each of sample curves.

References

P. J. Rousseeuw, I. Ruts, J. W. Tukey (1999): The bagplot: a bivariate boxplot, The American Statistician, vol. 53, no. 4, 382-387 R. J. Hyndman and H. L. Shang. (2010) Rainbow plots, bagplots, and boxplots for functional data, Journal of Computational and Graphical Statistics, 19(1), 29-45

Examples


set.seed(1)
n <- 420
pts <- seq(0, 1, by=0.05)
sampWiener <- Wiener(n, pts)
sampWiener <- Sparsify(sampWiener, pts, 10)
res <- FPCA(sampWiener$Ly, sampWiener$Lt, 
            list(dataType='Sparse', error=FALSE, kernel='epan', verbose=TRUE))
CreateOutliersPlot(res)


fdapace documentation built on Aug. 16, 2022, 5:10 p.m.