depthgram {roahd}R Documentation

Depthgram for univariate and multivariate functional data sets

Description

This function computes the three 'DepthGram' representations from a p-variate functional data set.

Usage

depthgram(
  Data,
  marginal_outliers = FALSE,
  boxplot_factor = 1.5,
  outliergram_factor = 1.5,
  ids = NULL
)

## Default S3 method:
depthgram(
  Data,
  marginal_outliers = FALSE,
  boxplot_factor = 1.5,
  outliergram_factor = 1.5,
  ids = NULL
)

## S3 method for class 'fData'
depthgram(
  Data,
  marginal_outliers = FALSE,
  boxplot_factor = 1.5,
  outliergram_factor = 1.5,
  ids = NULL
)

## S3 method for class 'mfData'
depthgram(
  Data,
  marginal_outliers = FALSE,
  boxplot_factor = 1.5,
  outliergram_factor = 1.5,
  ids = NULL
)

Arguments

Data

A list of length L (number of components) in which each element is an ⁠N x P⁠ matrix with N individuals and P time points. Alternatively, it can also be an object of class fData or of class mfData.

marginal_outliers

A boolean specifying whether the function should return shape and amplitude outliers over each dimension. Defaults to FALSE.

boxplot_factor

A numeric value specifying the inflation factor for marginal functional boxplots. This is ignored if marginal_outliers == FALSE. Defaults to 1.5.

outliergram_factor

A numeric value specifying the inflation factor for marginal outliergrams. This is ignored if marginal_outliers == FALSE. Defaults to 1.5.

ids

A character vector specifying labels for individual observations. Defaults to NULL, in which case observations will remain unlabelled.

Value

An object of class depthgram which is a list with the following items:

References

Aleman-Gomez, Y., Arribas-Gil, A., Desco, M. Elias-Fernandez, A., and Romo, J. (2021). "Depthgram: Visualizing Outliers in High Dimensional Functional Data with application to Task fMRI data exploration".

Examples

N <- 2e2
P <- 1e3
grid <- seq(0, 1, length.out = P)
Cov <- exp_cov_function(grid, alpha = 0.3, beta = 0.4)

Data <- list()
Data[[1]] <- generate_gauss_fdata(
  N,
  centerline = sin(2 * pi * grid),
  Cov = Cov
)
Data[[2]] <- generate_gauss_fdata(
  N,
  centerline = sin(2 * pi * grid),
  Cov = Cov
)
names <- paste0("id_", 1:nrow(Data[[1]]))

DG1 <- depthgram(Data, marginal_outliers = TRUE, ids = names)

fD <- fData(grid, Data[[1]])
DG2 <- depthgram(fD, marginal_outliers = TRUE, ids = names)

mfD <- mfData(grid, Data)
DG3 <- depthgram(mfD, marginal_outliers = TRUE, ids = names)

[Package roahd version 1.4.3 Index]