Learn R Programming

roahd

The roahd (Robust Analysis of High-dimensional Data) package allows to use a set of statistical tools for the exploration and robustification of univariate and multivariate functional datasets through the use of depth-based statistical methods.

In the implementation of functions, special attention was put to their efficiency, so that they can be profitably used also for the analysis of high-dimensional datasets.

For a full-featured description of the package, please take a look at the roahd vignette.

Installation

Install the released version of roahd from CRAN:

install.packages("roahd")

Or install the development version from GitHub with:

# install.packages("remotes")
remotes::install_github("astamm/roahd")

fData and mfData objects

A simple S3 representation of functional data object, fData, allows to encapsulate the important features of univariate functional datasets (like the grid of the dependent variable, the pointwise observations, etc.):

library(roahd)

# Grid representing the dependent variable
grid = seq( 0, 1, length.out = 100 )

# Pointwise measurements of the functional dataset
Data = matrix( c( sin( 2 * pi * grid ),
                  cos ( 2 * pi * grid ),
                  sin( 2 * pi * grid + pi / 4 ) ), ncol = 100, byrow = TRUE )

# S3 object encapsulating the univariate functional dataset            
fD = fData( grid, Data )

# S3 representation of a multivariate functional dataset
mfD = mfData( grid, list( 'comp1' = Data, 'comp2' = Data ) )

Also, this allows to exploit simple calls to customized functions which simplifies the exploratory analysis:

# Algebra of fData objects
fD + 1 : 100
fD * 4

fD + fD

# Subsetting fData objects (providing other fData objects)
fD[ 1, ]
fD[ 1, 2 : 4]

# Sample mean and (depth-based) median(s)
mean( fD )
mean( fD[ 1, 10 : 20 ] )
median_fData( fD, type = 'MBD' )
# Plotting functions
plot( fD )
plot( mean( fD ), lwd = 4, add = TRUE )
plot( fD[ 2:3, ] )

Robust methods for functional data analysis

A part of the package is specifically devoted to the computation of depths and other statistical indices for functional data:

  • Band depths and modified band depths,
  • Modified band depths for multivariate functional data,
  • Epigraph and hypograph indexes,
  • Spearman and Kendall’s correlation indexes for functional data,
  • Confidence intervals and tests on Spearman’s correlation coefficients for univariate and multivariate functional data.

These also are the core of the visualization / robustification tools like functional boxplot (fbplot) and outliergram (outliergram), allowing the visualization and identification of amplitude and shape outliers.

Thanks to the functions for the simulation of synthetic functional datasets, both fbplot and outliergram procedures can be auto-tuned to the dataset at hand, in order to control the true positive outliers rate.

Citation

If you use this package for your own research, please cite the corresponding R Journal article:

To cite roahd in publications use:

  Ieva, F., Paganoni, A. M., Romo, J., & Tarabelloni, N. (2019). roahd
  Package: Robust Analysis of High Dimensional Data. The R Journal,
  11(2), pp. 291-307.

A BibTeX entry for LaTeX users is

  @Article{,
    title = {{roahd Package: Robust Analysis of High Dimensional Data}},
    author = {Francesca Ieva and Anna Maria Paganoni and Juan Romo and Nicholas Tarabelloni},
    journal = {{The R Journal}},
    year = {2019},
    volume = {11},
    number = {2},
    pages = {291--307},
    url = {https://doi.org/10.32614/RJ-2019-032},
  }

Copy Link

Version

Install

install.packages('roahd')

Monthly Downloads

338

Version

1.4.3

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Aymeric Stamm

Last Published

November 4th, 2021

Functions in roahd (1.4.3)

EI

Epigraph Index of univariate functional dataset
MBD

Modified Band Depth for univariate functional data
MBD_relative

Relative Modified Band Depth of functions in a univariate functional dataset
BTestSpearman

Bootstrap Hypothesis Test on Spearman Correlation Coefficients for Multivariate Functional Data
BCIntervalSpearman

Bootstrap Confidence Interval on Spearman's Correlation Coefficient between Univariate Functional Datasets
BD

Band Depth for univariate functional data
BD_relative

Relative Band Depth of functions in a univariate functional dataset
HRD

Half-Region Depth for univariate functional data
HI

Hypograph Index of univariate functional dataset
cor_kendall

Kendall's tau correlation coefficient for bivariate functional data
cor_spearman

Spearman's correlation coefficient for multivariate functional data
area_under_curve

Area under curve of elements of univariate functional data
as.mfData

Converting object to mfData class
BCIntervalSpearmanMultivariate

Bootstrap Confidence Interval on Spearman's Correlation Coefficient of a Multivariate Functional Dataset
MHI

Modified Hypograph Index of univariate functional dataset
MEI

Modified Epigraph Index of univariate functional dataset
append_mfData

Append two compatible multivariate functional datasets
fDColorPalette

A set of fancy color to plot functional datasets
area_ordered

Area-under-curve order relation between univariate functional data
fData

S3 Class for univariate functional datasets.
exp_cov_function

Exponential covariance function over a grid
depthgram

Depthgram for univariate and multivariate functional data sets
MHRD

Modified Half-Region Depth for univariate functional data
cor_spearman_accuracy

Bootstrap Spearman's correlation coefficient for multivariate functional data
append_fData

Append two compatible univariate functional datasets
cov_fun

Covariance function for functional data
generate_gauss_mfdata

Generation of gaussian multivariate functional data
median_fData

Median of a univariate functional dataset
mean.mfData

Cross-sectional mean of of a mfData object.
mfD_healthy

ECG trace of healthy subjects
mfData

S3 class for multivariate functional datasets
mfD_LBBB

ECG trace of subjects suffering from Left-Bundle-Branch-Block (LBBB)
plot.Cov

Specialized method to plot Cov objects
generate_gauss_fdata

Generation of gaussian univariate functional data
fbplot

Functional boxplot of univariate and multivariate functional data
median_mfData

Median of a multivariate functional dataset
multiMBD

(Modified) Band Depth for multivariate functional data
minima

Minima of a univariate functional dataset
%>%

Pipe operator
multivariate_outliergram

Outliergram for multivariate functional datasets
outliergram

Outliergram for univariate functional data sets
plot.depthgram

Specialized method to plot 'depthgram' objects
warp

Warp elements of a univariate functional dataset
roahd

roahd: RObust Analysis for High dimensional Data.
plot.fData

Specialized method to plot fData objects
set_alpha

Function to setup alpha value for a set of colors
sub-.mfData

Operator sub-.mfData to subset mfData objects
sub-.fData

Operator sub-.fData to subset fData objects
mean.fData

Cross-sectional mean of of a fData object.
multiMHI

Modified Hypograph Index for multivariate functional data
max_ordered

Maximum order relation between univariate functional data
multiMEI

Modified Epigraph Index for multivariate functional data
maxima

Maxima of a univariate functional dataset
times-.fData

Operator * and / for fData objects
toListOfValues

Manipulation of mfData list of values
unfold

Unfolding a univariate functional dataset
plus-.fData

Operator + and - for fData objects
toRowMatrixForm

Conversion of vector/array/matrix to row-matrix form
plot.mfData

Specialized method to plot mfData objects