fHeatmap: Draws a heatmap of functional depth values or distances

View source: R/fHeatmap.R

fHeatmapR Documentation

Draws a heatmap of functional depth values or distances

Description

Draws a heatmap of depth values or distances of functional data.

Usage

fHeatmap(rowValues, cellValues, type, legend.title = "")

Arguments

rowValues

Vector of functional depth or distance values. Each value should correspond with the functional depth or distance of an observation from a (multivariate) functional data set.

cellValues

Matrix of multivariate depth or distance values. The value in row i and column j should correspond with the multivariate depth or distance of observation i at time point j.

type

One of "depth" or "distance". Determines whether a depth or a distance heatmap is drawn.

legend.title

Title of the legend.

Details

On the vertical axis the functional data are sorted from top to bottom according to their functional depth or distance value as provided in rowValues. When type = "depth", the deepest observation is put at the bottom. When type = "distance", the rows are sorted in decreasing order of their functional distance.

Each cell of the map is colored according to the multivariate depth provided in cellValues. For a depth-based heatmap, the smallest depth value is white and the overall highest depth value is colored dark green. A distance-based heatmap colors the cells from white to dark red.

Author(s)

P. Segaert

References

Hubert M., Rousseeuw P.J., Segaert P. (2015). Multivariate functional outlier detection (with rejoinder). Statistical Methods & Applications, 24, 177–202.

Examples

data(octane)
Result <- mfd(octane, diagnostic = TRUE, type = "sprojdepth")
Plot <- fHeatmap(rowValues = Result$MFDdepthZ,
                 cellValues = Result$crossdepthZ,
                 type = "depth",
                 legend.title = "SPD")
Plot

Result <- fOutl(octane, diagnostic = TRUE, type = "fAO")
Plot <- fHeatmap(rowValues = Result$fOutlyingnessZ,
                 cellValues = Result$crossDistsZ,
                 type = "distance",
                 legend.title = "AO")                 
Plot

mrfDepth documentation built on May 29, 2024, 5:04 a.m.