R: Compute functional depth.

fdepth {rainbow} | R Documentation

## Compute functional depth.

### Description

Compute functional depth.

### Usage

    fdepth(data, type = c("FM", "mode", "RP", "RPD", "radius"), trim = 0.25, alpha, weight)

### Arguments

`data` | An object of class `fds` or `fts`.
`type` | Type of functional depth. See detail section below.
`trim` | Percentage of trimming.
`alpha` | Tuning parameter used when `type = "radius"`.
`weight` | Hard-thresholding or soft-thresholding when `type = "radius"`.

### Details

If `type = "FM"`, it computes the functional depth of Fraiman and Muniz (2001), which is considered as the first functional depth.

If `type = "mode"`, it computes the functional depth of Cuevas et al. (2006). A functional mode is defined as the curve most densely surrounded by the rest of curves of the dataset.

If `type = "RP"` and `type = "RPD"`, it computes random projection functional depth of Cuevas et al. (2007). Cuevas et al. (2007) considered the random projection depth based on measuring the depth of the functional data under projections and taking additional information of their derivatives. The basic idea is to project each functional curve, along a random direction, defining a point in R^2. A data depth in R^2 provides an order of the projected points.

If `type = "radius"`, it ranks the curves according to alpha-radius. Then using the hard thresholding or soft thresholding, trimmed mean and median can be computed.

The argument trim = 0.25 first order curves by depth, and then trim 25 percent curves that have comparably lower depth.

### Value

A list containing the following components is returned.

`median` | Median curve (highest depth).
`lmed` | Index of median curve.
`ltrim` | Indexes of the trimmed curves.
`prof` | Functional depth for each curve.
`mtrim` | Mean of trimmed curves.
`weight` | Weight values for all observations, when `type = "radius"`.

### Author(s)

Han Lin Shang

### References

R. Fraiman and G. Muniz (2001) "Trimmed means for functional data", Test, 10(2), 419-440.

A. Cuevas and M. Febrero and R. Fraiman (2001) "Cluster Analysis:a further approach based on density estimation", Computational Statistics \& Data Analysis, 36(4), 441-456.

A. Cuevas and M. Febrero and R. Fraiman (2006) "On the use of bootstrap for estimating functions with functional data", Computational Statistics \& Data Analysis, 51(10), 1063-1074.

A. Cuevas and M. Febrero and R. Fraiman (2007) "Robust estimation and classification for functional data via projection-based depth notions", Computational Statistics, 22(3), 481-496.

M. Febrero and P. Galeano and W. Gonzalez-Manteiga (2007) "A functional analysis of NOx levels: location and scale estimation and outlier detection", Computational Statistics, 22(3), 411-427.

M. Febrero and P. Galeano and W. Gonzalez-Manteiga (2008) "Outlier detection in functional data by depth measures, with application to identify abnormal NOx levels", Environmetrics, 19(4), 331-345.

M. Febrero and P. Galeano and W. Gonzalez-Manteiga (2010) "Measures of influence for the functional linear model with scalar response", Journal of Multivariate Analysis, 101(2), 327-339.

J. A. Cuesta-Albertos and A. Nieto-Reyes (2010) "Functional classification and the random Tukey depth. Practical issues", Combining Soft Computing and Statistical Methods in Data Analysis, Advances in Intelligent and Soft Computing, Volume 77, 123-130.

D. Gervini (2012) "Outlier detection and trimmed estimation in general functional spaces", Statistica Sinica, 22(4), 1639-1660.

P. Rana, G. Aneiros and J. M. Vilar (2015) "Detection of outliers in functional time series", Environmetrics, 26, 178-191.

### Examples

    fdepth(data = ElNino, type = "FM")
    fdepth(data = ElNino, type = "mode")
    fdepth(data = ElNino, type = "RP")
    fdepth(data = ElNino, type = "RPD")
    fdepth(data = ElNino, type = "radius", trim = 0.25, alpha = 0.5, weight = "hard")
    fdepth(data = ElNino, type = "radius", trim = 0.25, alpha = 0.5, weight = "soft")

[Package rainbow version 3.5 Index]