Skip to main content
NIHPA Author Manuscripts logoLink to NIHPA Author Manuscripts
. Author manuscript; available in PMC: 2026 Jul 8.
Published in final edited form as: Stat Med. 2026 Apr;45(8-9):e70511. doi: 10.1002/sim.70511

Wasserstein Boxplots for the Analysis of EEG Power Spectral Densities with Applications to Autism

Puyuan Liu 1, Donatello Telesca 1, Abigail Dickinson 2, Shafali Jeste 3, Damla Şentürk 1
PMCID: PMC13340344  NIHMSID: NIHMS2186555  PMID: 41923592

Abstract

Functional boxplots are an informative exploratory tool for visualizing functional data and providing a concise summary of a dataset’s central tendency, spread, and potential outliers. Motivated by within- and across-sample visualization of electroencephalogram (EEG) power spectral densities in autism studies, we propose Wasserstein boxplots for summarizing a sample of densities. Densities take on nonnegative values and integrate to 1. In order to take into account the constraints of the signal and to avoid metric distortions associated with transformations, the proposed Wasserstein boxplots utilize the 2-Wasserstein metric for quantifying distances between densities. In addition, the proposed boxplots extend the traditional approach of summarizing central tendency within a single dataset to comparative settings where central tendency of data within a target sample is quantified with respect to a reference group. Cross-sample Wasserstein boxplots are motivated by quantification of deviations in power spectra of autistic children (target group) from neurotypical development (reference group). Finally, covariate-adjusted boxplots are proposed for quantifying deviations in the target group from the Fréchet mean in the reference group, conditional on covariates. A unique feature of EEG power spectra is the peak alpha frequency (PAF), which shifts to higher frequencies as children age. Hence, covariate-adjusted boxplots are used to quantify deviations in the autistic sample from neurotypical spectra, conditional on age. The proposed exploratory tools, especially the comparative analyses are applicable more broadly, beyond the motivating autism context, to studies involving both a target and a reference group.

Keywords: distance profile, electroencephalography, Fréchet regression, optimal transport, visualization, Wasserstein metric

1. Introduction

Boxplots are effective visualization tools for summarizing numerical distributions in terms of central tendency, dispersion, and skewness. They have also been extended to a sample of functional data using functional bagplots1 and functional boxplots.1–5 These extensions rely on depth measures which are either distance-based or non-distance based. More commonly used non-distance based approaches extend Tukey’s halfspace depth6 and simplicial depth7 to random Tukey depth, integrated dual depth,8 band depth (BD) and modified band depth (MBD),9 half-region depth (HRD),10 and extremal depth (ED)11 to be used in functional settings. While non-distanced based approaches assess centrality based on the relative positioning of functions within a dataset, distance-based approaches use distance metrics to quantify the magnitude of deviations between functions.12–14

Motivated by providing a visual summary of EEG power spectral densities while highlighting differences between autistic and neurotypical groups, we propose Wasserstein boxplots, a distance-based approach, to provide a visual summary of a sample of densities and extend developments to contrastive settings with a target and a reference group and consider covariate adjustments. Resting state electroencephalography (EEG) data are typically studied in the frequency domain using power spectral densities obtained via Fast Fourier Transform (FFT). Our motivating data comes from a study on peak alpha frequency (PAF) denoting the frequency of a prominent peak in the power spectral density within the alpha band using EEG measurements collected from 58 autistic children and their 39 neurotypical peers during resting state. While PAF shifts to higher frequencies in neurotypical development, this shift is delayed or absent in children with autism.15–19

Densities cannot be modeled as functional data as they adhere to specific constraints. The proposed boxplots take into account the constraints that densities take on nonnegative values and integrate to 1, using the 2-Wasserstein metric. In addition, while traditional boxplots typically consider a single sample, we extend developments to contrastive settings where the primary goal is to visualize deviations of subjects within a target group from a reference group, possibly accounting for covariate effects. Note that a distance-based approach is more desirable in contrastive settings since the goal directly involves quantifying deviations of subjects within the target group from the reference group. In applications to visualizations of EEG power spectra from resting state, the proposed Wasserstein boxplots help summarize deviations of the autistic subjects from their neurotypical peers and further quantify deviations of the autistic group from the conditional mean reflecting age-specific neurotypical development. Hence, covariate-adjusted Wasserstein boxplots can summarize PAF features in the autistic sample in terms of deviations from the age-adjusted mean of this developmental marker in the neurotypical group.

The analysis of data objects in non-Euclidean spaces has received renewed attention in the last decade.20, 21 Complex data objects are encountered increasingly in data applications, where the main interest is in modeling densities, multivariate distributions or correlation matrices that live on unique constrained manifolds. While one dimensional densities can be modeled via the 2-Wasserstein metric, L2 distance between their quantile functions, symmetric, positive definite correlation matrices can be modeled with the Frobenius metric and multivariate distribution can be modeled by Fisher-Rao metric defined as the geodesic distance for the square root of densities. Developments in non-Euclidean metric spaces include Fréchet regression of data objects on Euclidean predictors,22, 23 Wasserstein regression with random distributions serving as both response and predictors,24, 25 and metric statistics, characterizing data objects via distance profiles (i.e., distribution of distances from the random object to all other data objects).27 These developments seem quite general as they do not rely on local or global Euclidean structures; however, they rely on the appropriate incorporation of subject matter expertise to lead to interpretable results in practice. We utilize developments in the Wasserstein space, including Wasserstein transports, Fréchet regression of densities on scalar covariates and distance profiles in developing Wasserstein boxplots to summarize deviations in the power spectra of the autism group from neurotypical development.

Our framework introduces three types of Wasserstein boxplots: within-sample, cross-sample and covariate-adjusted. The within-sample Wasserstein boxplots evaluate the centrality of a density within a sample of densities, using distance profiles and optimal transport. More specifically, the CDF of pairwise Wasserstein distances from a particular density to all other densities within a sample is referred to as a distance profile. Densities with distance profiles close to zero tend to be more central within the sample, at shorter length from the rest of the sample. Optimal transport represents a push-forward map (or mass transfer) to transport one distance profile to another.28 Averaging the integrated mass transfer to transport one distance profile to all others associated with densities within a sample provides a raw centrality score for a density. Densities with distance profiles close to zero will correspond to positive mass transfer (i.e. shifting to the right) to align with other distance profiles of the sample, resulting in higher raw centrality scores. Inverse logit transformation of raw centrality scores provides a center-outward ranking within a sample of densities.27 The highest-ranked density is marked as the within-group median, while the densities with the top 25%, 50%, and 75% of the rank distribution define the corresponding central envelopes. In contrast to the traditional interquantile range (IQR), which is defined as the difference between the 75th and 25th percentiles, IQR in the Wasserstein boxplot is defined as the range (maximum minus minimum) of the top 50% raw centrality scores. Densities with raw centrality scores more than three times the IQR below the median of raw centrality scores are flagged as outliers. An alternative outlier detection criterion is also proposed for controlling false positive rates for skewed raw centrality scores. The skewness-adjustment adapts the outlier detection threshold by scaling the IQR multiplier according to the asymmetry of the raw centrality scores.

The proposed cross-sample Wasserstein boxplots extend the proposed framework to contrastive settings involving a target and a reference sample. Cross-sample Wasserstein boxplots go well-beyond moment- or distribution-based group comparisons involving separate summaries of group characteristics. They allow for joint analysis with a focus on characterizing subject-specific deviations within the target group from the reference sample. Hence, densities within the target group are summarized in terms of their deviation from the reference sample. To achieve cross-sample rankings of densities in the target sample, cross-sample distance profiles summarize pairwise distances between a density within the target group and all densities within the reference group. A target sample density with a cross-sample distance profile close to zero would be considered central in comparison to the reference sample, leading to a higher cross-sample centrality score (through summary of optimal transport to other cross-sample distance profiles within the target sample).

In some applications such as our motivating data, key covariates should be accounted for in comparisons with the reference group. In the PAF example with well-documented age-related shifts in PAF in neurotypical development, the interest is in ranking of autistic subjects with respect to the neurotypical EEG spectra observed at their age. In other words, while the interest for a younger autistic subject is in comparison to neurotypical spectra with an earlier PAF, older autistic subjects would be compared to spectra with higher PAFs. Hence covariate-adjusted Wasserstein boxplots rank autistic subjects with respect to their deviation from their age-expected neurotypical spectra. To rank subjects within the target group with respect to deviations from the covariate-specific benchmark in the reference group, covariate-adjusted Wasserstein boxplots utilize the Fréchet mean estimates conditional on covariates within the neurotypical sample. The deviations between densities from the target group and the respective conditional Fréchet means are quantified by optimal transport maps that move mass from each target density to its conditional Fréchet mean from neurotypical development. These transports can be viewed as cross-sample Fréchet regression residuals. Covariate-adjusted boxplots are based on visualization of these cross-sample residuals, illustrating how the densities in the target group deviate from their covariate-adjusted means in the reference group.

The structure of the paper is as follows. Section 2 provides a review of the utilized tools from the Wasserstein metric space. The proposed Wasserstein boxplots are outlined in Section 3 where they are further applied to the study of resting state EEG spectral densities in Section 4. Extensive simulation studies on the efficacy of the proposed methodology in identification of outliers as well as characterization of deviations from covariate-adjusted Fréchet means are presented in Section 5. The outlier detection performance of Wasserstein boxplots are compared with five existing functional data outlier detection methods: modified band depth (MBD),9 extremal depth (ED),11 the outliergram (OG),5 the decomposition of total variation depth (TVD),29 and magnitude-shape plot based on directional outlyingness (DO).30 Extensions of the proposed methodology for future research are deferred to Section 6.

2. Tools from Wasserstein metric space analysis

We begin by reviewing tools from the 2-Wasserstein metric space that will be used in our proposed framework of Wasserstein boxplots. Recent work showed how several tightly linked constructions in the one-dimensional 2-Wasserstein space come together to give an intrinsic ordering of probability densities.26, 27 The Wasserstein space respects the inherent constraints of non-negativity and integrating to 1 for densities, allowing us to compute the distance between any two densities. This is the foundational step that enables the construction of the distance profile for each observation, which is a CDF representing that observation’s distance to the rest of the sample. Given that distance profiles are CDFs themselves, optimal transport theory can be leveraged to compare them. By averaging these transport costs, centrality scores are derived to provide sample rankings to densities, define the median, delineate the central regions, and help establish the outlier detection rules to construct Wasserstein boxplots. Finally, Fréchet regression is applied to adjust for covariate effects while comparing densities in target and reference groups, motivating the construction of covariate-adjusted Wasserstein boxplots.

For densities μ, ν with cumulative distribution functions (CDFs) Fμ and Fν, the 2-Wasserstein distance between μ and ν is the L2 distance between their quantile functions,

dW(μ,ν)=[∫01{Fμ−1(u)−Fν−1(u)}2du]1/2=dL2(Fμ−1,Fν−1)

For a density ω, its distance profile

Gω(t)=PrdW(ω,Z)≤t,Z∼P,t∈[0,∞)

characterizes how other distributions in the population P are distributed around ω in Wasserstein space. Here, ω and Z denote densities in the Wasserstein space. The index t represents thresholds over the support of the non-negative distance distribution. Since the underlying metric dW aggregates quantile differences via integration over the probability domain, the distance profile Gω(t) characterizes the CDF of the global distances between ω and other distributions from the same population. Empirically, distance profile is estimated from density samples zkk=1n as the proportion of observations within a Wasserstein ball of radius t centered at ω. Central densities exhibit profiles with rapid accumulation of mass near t = 0, reflecting proximity to the bulk of the data, while non-central observations show profiles with mass shifted toward larger t. Figures 1a and 1b illustrate an empirical example, where Figure 1a displays average EEG power spectra in the autistic group across 25 electrodes and Figure 1b shows their corresponding distance profiles. The most central average power spectrum, indicated in blue, is the observation that minimizes the average transport cost to all other densities in the sample. In the context of distance profiles, this centrality is characterized by the curve that accumulates probability mass rapidly near zero (specifically within the interval t ∈ (0, 0.1) in this application), indicating close 2-Wasserstein distance to the majority of the sample. In contrast, the density which lies furthest away from the center, shown in red, exhibits a distance profile with mass shifted farther from zero, indicating greater deviation from the group’s center.

Figure 1:

Figure 1:

(a-b) Electrode-specific power spectra (averaged over subjects) for the autistic group (a) and their corresponding within-sample Wasserstein distance profiles (b). The most central and peripheral spectra are depicted in blue and red, respectively. (c-d) Within-sample Wasserstein boxplots for the autistic (c) and neurotypical (d) groups. The dased red lines represent the detected outliers. (e-f) The location of the complete ordering of within-sample transport ranks (with smaller values indicating greater centrality) for the autistic (e) and neurotypical (f) groups.

To compare two densities ω and Z, their distance profiles Gω and GZ are aligned via the monotone optimal transport map

HZ,ω(v)=GZ−1Gω(v)−v,v∈[0,∞)

which quantifies the point-wise adjustment needed to morph Gω into GZ. By a change of variable, the integral

∫HZ,ωvdGωv=∫01GZ−1u−Gω−1udu,u∈0,1,

provides a summary measure of the total mass transport cost. Positive values indicate ω is more central than Z (mass shifts to the right to align Gω with GZ), while negative values imply the opposite.

The transport rank for each observation is synthesized across the entire population by averaging pairwise transport costs and scaling via the expit function expit(x)=ex/1+ex,

Rω=expitEZ∫01GZ−1(u)−Gω−1(u)du,u∈0,1.

This rank Rω∈(0,1) induces a center-outward ordering: high ranks correspond to centrally located distributions, while low ranks correspond to observations that lie further away from the center. The expit function ensures interpretability by mapping unbounded transport integrals to a standardized scale.

The Wasserstein metric and optimal transport maps,26 combined with the distance profiles and transport ranks,27 provide a rigorous foundation for assigning center-outward ranks for a group of densities. However, there is a lack of visualization tools to provide a meaningful summary of densities. Section 3 introduces the methodological details for constructing Wasserstein boxplots, where central regions are defined by high-rank densities, while outliers are identified through anomalously low ranks. Unlike traditional methods, this approach respects the geometry of distributional data, enabling visualization and analysis that align with the inherent properties of the Wasserstein space.

Finally, Fréchet regression provides a powerful tool to model and adjust for covariate effects while modeling complex random objects such as densities.22 Fréchet extended the concept of mean to cover random objects taking values in general metric spaces.31 Let (X, Y) denote covariates X∈Rp and distributional outcomes Y∈Ω,dW, where p represents the dimension of the covariate vector. In our application to modeling of EEG power spectra, age (p = 1) is considered as a relevant covariate in modeling the chronological shift of PAF in neurotypical development.

The Fréchet mean is defined as

ω⊕=argminω∈ΩEdW2Y,ω.

The Fréchet regression function of Y given X = x is introduced based on the above classical concept of Fréchet mean and extends to the notion of a conditional Fréchet mean,

M⊕⋅,x=EdW2Y,⋅∣X=x,m⊕x=argminω∈ΩM⊕ω,x,

where M⊕(·, x) is referred to as the conditional Fréchet function and m⊕(x) is defined as the conditional Fréchet mean. Fréchet regression will be utilized in the next section for construction of covariate-adjusted Wasserstein boxplot based on the conditional Fréchet mean.

3. Proposed Wasserstein Boxplots

We propose three Wasserstein boxplots: the within-sample, cross-sample and covariate-adjusted Wasserstein boxplot. We begin with a single group setting, where the centrality of each observation is evaluated relative to others within the same group, forming the basis of the within-sample Wasserstein boxplot. The proposed set-up is then extended to a contrastive setting, where the central tendency of data within a target group is quantified with respect to a reference group, leading to the development of the cross-sample Wasserstein boxplot. Furthermore, covariate-adjusted Wasserstein boxplot is proposed to quantify deviations in the target group from the Fréchet mean in the reference group, conditional on covariates. This extension is particularly useful for situations where certain covariates are strongly associated with the density distributions.

3.1. Within-sample Wassertstein boxplot

We propose the within-sample Wasserstein boxplot for summarizing and visualizing densities within a single group. Letting xi, i=1,…,nx, denote densities within a group, the within-sample Wasserstein boxplot computes distance profile of each density xi via

G^xi(t)=1nx−1∑i′≠iIdWxi,xi′≤t,t≥0,

using pairwise Wasserstein distances

dWxi,xi′=∫01Fxi−1(u)−Fxi′−1(u)2du1/2=dL2Fxi−1,Fxi′−1,

between xi and other densities xi′ within the group, where Fxi and Fxi′ denote CDFs of densities xi and xi′ and I denotes the indicator function. The estimated distance profile reflects the proportion of densities in the group that are within a certain Wasserstein distance from a given density xi. Densities with most pairwise distances concentrated at smaller values are considered centrally located within the group, with their Wasserstein distance profiles exhibiting greater mass close to zero. In contrast, densities with generally larger pairwise Wasserstein distances are considered non-central within the group. The raw centrality score quantifying the centrality of each density is computed by averaging the integrated transfer mass of its distance profile to those of all other densities, specifically,

C^xi=1nx−1∑i′≠i∫01G^xi′−1(u)−G^xi−1(u)du,u∈0,1.

Note that the centrality scores are derived from the 2-Wasserstein metric, which involves the integration of the continuous quantile functions. Consequently, the resulting raw centrality scores are continuous, indicating zero probability of ties in practice. The transport ranks, defined by R^xi=1/1+exp(−C^xi) for xi, arrange the densities in a center-outward order from highest to lowest rank where higher ranks indicates more central positions among the sample of curves. The transport ranks are strictly monotonic with respect to the centrality scores as the expit function is strictly increasing, preserving the center-outward ordering while scaling to [0, 1] for the convenience of interpretation.

The within-sample Wasserstein boxplot builds on transport ranks to summarize and visualize ordered densities by highlighting the median, defining the central envelopes and the interquartile range (IQR), and flagging potential outliers. Let x[i] represent the sample density corresponding to the i-th highest rank. Densities, x[1],…,x[n], can be interpreted as order statistics, where x[1] is the most central observation, referred to as the median density (highlighted in black in Wasserstein boxplots), and x[n] is the most peripheral observation. Color intensities are used to differentiate ranking groups: the top 25% most central region appears in the darkest shaded area, the 25-50% most central region in intermediate shade, and the 50-75% region in the lightest shade.

Since the raw centrality scores provide scalar summaries of density centrality, we establish outlier detection rules directly in the real space. Unlike the traditional IQR, which is defined as the difference between the 75th and 25th percentiles of the data, IQR in the Wasserstein boxplot is defined as the range (maximum minus minimum) of the top 50% raw centrality scores. Outlier detection is achieved by setting a threshold Lb of the median of the raw centrality scores minus 3 times the IQR, expressed as Lb=Q2({C^xi})−3⋅IQR, where Q2 denotes the sample median. The choice of a factor of three reflects the inherently one-sided distribution of transport-based ranks, in contrast to the symmetric whisker extension of the classical IQR rule of multiplying a factor of 1.5. Densities with raw centrality scores below this threshold (C^xi<Lb) are identified as outliers and displayed as red dashed lines. For non-outlying densities (C^xi≥Lb), the maximum and minimum values at each frequency level define a blue-bordered white envelope, providing a clear visual depiction of the representative range.

For applications requiring more conservative outlier detection, we propose a skewness-adjusted threshold that scales the IQR multiplier based on the extent of asymmetry in the distribution of raw centrality scores. This adjustment aims to control false positive rates, excessive identification of incorrect outliers, when the raw centrality scores are heavily left-skewed. Consider the medcouple statistic (MC),32 a robust measure of distributional skewness defined as MC=medianxi≤Q2≤xi′Kxi,xi′, where the kernel function K is given by Kxi,xi′=xi′−Q2−Q2−xi/xi′−xi, for all xi≠xi′ and xi≤Q2≤xi′. The MC always lies between −1 and 1 where a positive value indicates a right-skewed distribution and a negative value signifies left-skewness. Utilizing the MC statistic, the adjusted boxplot proposed by Hubert and Vandervieren33 adapts outlier detection thresholds by differentially scaling the standard 1.5 IQR multiplier based on the MC’s sign and magnitude, effectively tilting the thresholds towards the heavier tail.

The skewness-adjusted Wasserstein boxplot builds upon this principle in proposing an adaptive outlier detection threshold of raw centrality scores. The proposed adjustment uses a skewness-adjusted multiplier 3×ea⋅MC, where a < 0 is a tuning parameter (default a = −1) controlling sensitivity to skewness. The adjusted lower threshold for outlier detection is scaled as Lbadj=Q2({C^xi})−3⋅ea⋅MC⋅ IQR. This adjustment dynamically expands or tightens the threshold depending on the skewness of the distribution. For instance, if raw centrality scores are left-skewed (common in many datasets), the threshold is lowered for more conservative detection. Conversely, for right-skewed distributions, the threshold is raised to capture more outliers.

Extending the proposed framework to contrastive settings involving a target and a reference group, two additional variations of the Wasserstein boxplot are introduced next. These methods allow for contrastive analysis and adjustments based on covariates, providing deeper insights into applications such as the distributions of EEG power spectra across autistic and neurotypical groups.

3.2. Cross-sample Wasserstein boxplot

Cross-sample Wasserstein boxplots extend developments to contrastive settings with a target (e.g., autism) and a reference (e.g., neurotypical) group. Let xi, i=1,…,nx, and yj, j=1,…,ny, denote densities in the target and reference groups, respectively. The difference between within-sample and cross-sample Wasserstein boxplots lies in how distance profiles are constructed and how transport ranks are assigned. In the within-sample boxplot, each density is evaluated relative to others within the same sample, while in the cross-sample approach each density in the target group is assessed relative to a reference group by computing Wasserstein distances between a target density xi and all reference densities yj. In what follows, superscripts CS are used to distinguish quantities proposed defined in the cross-sample setting.

The cross-sample distance profile, defined as

G^xiCS(t)=1ny∑j=1nyIdWxi,yj≤t,t≥0,

captures how closely each target density aligns with the reference group. Since all cross-sample distance profiles are computed relative to the same reference group, they are directly comparable across the target group, assessing the deviation of each target power spectrum from typical patterns observed in the reference group. The cross-sample raw centrality score for xi is calculated next by averaging the integrated transfer mass of its cross-sample distance profile to those of all other elements in the target group,

C^xiCS=1nx−1∑i′≠i∫01G^xi′CS−1(u)−G^xiCS−1(u)du,u∈0,1.

where G^xiCS−1(u) and G^xi′CS−1(u) denote the quantile functions corresponding to the estimated cross-sample distance profiles of the i-th and i′-th densities in the target group. The cross-sample centrality score provides a measure of how central xi is located within the target group when considered relative to the reference group, by comparing the cross-sample distance profile of xi to cross-sample distance profiles of other densities in the target group. Higher cross-sample raw centrality scores signal closer alignment with the reference sample, with cross-sample ranks provided by R^xiCS=1/1+exp⁡(−C^xiCS). Based on the order statistics induced by the cross-sample ranks, a cross-sample Wasserstein boxplot can be constructed by identifying the median, defining the central envelopes and IQR, and flagging potential outliers, following the same steps as described in construction of the within-sample Wasserstein boxplot.

3.3. Covariate-adjusted Wasserstein boxplot

Covariate-adjusted Wasserstein boxplots allow for comparison of target densities with a reference group adjusted for key covariates. More specifically, deviations are quantified for target densities from Fréchet mean in the reference group conditional on covariates.

First consider the Fréchet regression of densities y ∈ Ω in the reference group on the vector of covariates a∈RP. For a given ai, the conditional Fréchet mean of y is defined as

M⊕⋅,ai=EdW2(y,⋅)∣a=ai,m⊕ai=argminω∈ΩM⊕ω,ai.

Since the distributions in the reference group represent typical patterns, these conditional Fréchet means serve as a baseline for assessing how target group observations deviate from covariate-adjusted expected norms in the reference sample. To quantify the deviation of each target observation (with covariate value ai) from their covariate-adjusted Fréchet mean in the reference group, the optimal transport map moving mass from the CDF of the observed distribution xi to the CDF of the conditional Fréchet mean m⊕ai at ai is utilized,

Hm⊕ai,xiv=Fm⊕ai−1Fxiv−v,v∈R,

where Fm⊕(ai)−1 denotes the quantile function of the conditional Fréchet mean of y given covariate ai, and Fxi denotes the CDF of xi. The transport map Hm⊕ai,xi(v) can be viewed as a cross-sample Fréchet regression residual, signaling deviations from covariate-adjusted trends in the reference group. Note that the cross-sample Fréchet regression residuals are functional data and a functional boxplot is utilized in their visualization in studying covariate-adjusted cross-sample trends, following Fréchet regression. We utilize functional boxplots based on modified band depth (MBD)9 in the summary of the Fréchet regression residuals in applications presented in subsequent sections.

4. Data Analysis

We utilize the proposed Wasserstein boxplots in the study of EEG power spectra from resting state. Our motivating study collected EEG data from 58 autistic children and their 39 neurotypical peers of age 2 to 12 years old, with the goal of studying developmental trends in peak alpha frequency (PAF). The continuous resting state EEG signal was recorded using a high-density electrode array with a total length of two minutes, acquired at a sampling rate of 500 Hz. The data were band-pass filtered to remove frequencies below 1 Hz above 100 Hz. Continuous data were visually inspected, and noisy channels were removed. Following channel removal, data were interpolated to the international 10–20 system 25-channel montage. Finally, Independent Component Analysis (ICA) was implemented to identify and remove noise from non-neural source (including electromyogram and electrooculogram). To ensure comparable data quality and quantity across the sample, the analysis considered the first 38 seconds of clean, artifact-free data, which represented the minimum amount of artifact-free data available across all participants. To capture temporal dynamics, time series from each channel are divided into overlapping two-second segments and transformed into the frequency domain via the Fast Fourier Transform (FFT). EEG power spectra was obtained by averaging spectral information across these segments at each electrode to enhance reliability by highlighting consistent patterns over time. Since the focus is the study of developmental trends in PAF, our analysis considers the power spectra normalized to integrate to 1 within the alpha frequency band (6-14 Hz). For further technical details regarding data acquisition and preprocessing, we direct the reader to Dickinson et al.15

The proposed within-sample Wasserstein boxplot is first employed to summarize trends across electrodes (averaged over subjects) within the autism and neurotypical groups. This analysis portrays similar trends in power spectral density in the alpha band across electrodes and highlights representative electrodes that are central to the set of power spectra calculated within each diagnostic group. Based on these findings, Wasserstein boxplots are utilized next to summarize trends in alpha band power spectra across subjects at a representative electrode (T8) for both diagnostic groups. As expected, spread in densities across subjects is much larger than spread observed across electrodes, where different developmental trends in PAF are detected across the diagnostic groups, leading to novel insights gained from the within-sample, cross-sample and covariate-adjusted Wasserstein boxplots.

As a preliminary analysis, electrode-specific power spectra (averaged over subjects within groups) are summarized using the within-sample Wasserstein boxplot. Figure 1a displays spectra from the autistic group collected at 25 electrodes given in Figure 1e. The median density given in blue (from electrode T9) has a within-sample distance profile that concentrates mass near zero (Figure 1b), with shorter distances to other densities within the autism group, while the most peripheral density (from electrode F9) given in red has mass distributed further away from zero (Figure 1b), with longer distances to other densities in the autism group. Utilizing within-sample distance profiles for the autistic and neurotypical groups, leads to within-sample transport ranks and within-sample Wasserstein boxplots given in Figures 1c and 1d, respectively. Power spectra across electrodes portray similar trends within both diagnostic groups with a slightly more well-defined alpha peak within the neurotypical group, where electrode F9 is identified as an outlier in both groups and electrode P10 is flagged as an outlier only in the neurotypical group.

In addition, the location of the complete ordering of within-sample transport ranks (with smaller order representing greater centrality) for electrodes within each diagnostic group is provided in Figures 1e (autism) and 1f (neurotypical). Left frontal electrodes (F9, F7, F3, FP1) are consistently found to be peripheral in both diagnostic groups, while parietal and occipital electrodes P9, P8, and O2 are found to be central. While the rankings largely agree across groups, there are also some differences (T9 is identified as the sample median in the autistic group, but is ranked 18 out of 25 in the neurotypical group). Based on these preliminary findings and results from prior literature,18 we next utilize within-sample, cross-sample and covariate-adjusted Wasserstein boxplots to summarize power spectra across subjects from each diagnostic group at electrode T8, which is found to be central in both diagnostic groups.

When depicting power spectra across subjects, we also compare results to five functional outlier detection methods. A comprehensive evaluation and comparison of the outlier detection performance by the Wasserstein boxplot and comparators is provided in the Simulation Section. The comparator methods include functional boxplots using modified band depth (MBD) and extremal depth (ED). The MBD is based on the average proportion of time a curve resides within the bands formed by subsets of the sample, while the ED prioritizes extreme pointwise deviations. Comparator methods also include detection methods which specifically target functional shape outliers: outliergram (OG) and total variation depth (TVD) combined with modified shape similarity. The OG identifies shape outliers by measuring how far each curve’s MBD deviates from the theoretical Modified Epigraph Index (MEI)–MBD parabola, while the TVD is a two-stage functional outlier detection method that first flags shape outliers using modified shape similarity and then detects magnitude outliers via a functional boxplot based on total variation depth. Finally, we compared results with magnitude-shape plot based on directional outlyingness (DO), a distance-based method that decompose outlyingness into magnitude and shape components.

When plotted across subjects, the spread in EEG power spectra is much larger than the spread across electrodes (Figure 2a displays spectra from 58 autistic children observed at electrode T8). Similar to previous observations on spectra across electrodes, the median density in blue corresponds to the distance profile with mass most concentrated near zero (Figure 2b), while the most peripheral density in red corresponds to the distance profile with mass furthest away from zero. Figures 2c and 2d display the within-sample Wasserstein boxplots of power spectra for autistic and neurotypical groups, respectively. Consistent with the developmental shift in PAF (towards higher frequency values) expected in the neurotypical group, the median density in the neurotypical group has a higher PAF at 9.3 Hz, compared to the PAF of the autistic group median at 8.2 Hz. In addition, the 50% envelope spans a broader frequency range in the neurotypical group compared to autism, signaling greater variability resulting from the developmental shift in PAF. While the Wasserstein boxplot, along with OG and the distance-based comparator DO detect no outliers in the neurotypical group (Figure 2d), non-distance based functional outlier detection methods MBD, ED and TVD, based on proportion of the curve lying outside the spread in the sample, identify 2-4 outliers either with large peak alpha frequency values or high PAF (Figure 2f). Distance-based methods, including the Wasserstein boxplot do not find these deviations as outlying accounting for the higher variation of distances between the power spectra in the neurotypical sample with PAF shifts within the range from 8 to 11 Hz.

Figure 2:

Figure 2:

(a-b) Power spectra at electrode T8 across children from the autistic group (a) and their corresponding within-sample Wasserstein distance profiles (b). The most central and peripheral spectra are depicted in blue and red, respectively. (c-d) Within-sample Wasserstein boxplots of EEG power spectra across children from the autistic (c) and neurotypical (d) groups. In the boxplots, the darkest, medium and lightest shaded areas correspond to the 25%, 50% and 75% central regions, respectively. The dased red lines represent the detected outliers. (e-f) Functional boxplots based on MBD for EEG power spectra across children from the autistic (e) and neurotypical (f) groups.

While the Wasserstein boxplot, MBD and TVD detect one outlier child who is 98 months old in the autism group (Figure 2c and 2e), given in purple in the cross-sample and covariate-adjusted Wasserstein boxplots plotted next in Figure 3, ED and OG identify no outliers and the other distance-based comparator DO identifies 3 outliers (including the child who is 98 months old). As will be shown next in the Simulation Section, while the distance-based DO performs best among comparators in detection of outliers with the highest true positive rate across different simulation scenarios, it also tends to detect a high percent of observations as outliers leading to high false positive rates. Detection of 3 outliers with DO is consistent with simulation results with high false positive rates, where DO utilizes the pointwise median as its reference for defining centrality. In the presence of horizontal shifts in PAF, this pointwise reference fails to capture the structural unity of the curves. The Wasserstein boxplot overcomes this issue through its global notion of centrality, accounting for the transport of probability mass.

Figure 3:

Figure 3:

(a-c) Within-sample (a), cross-sample (b), and covariate-adjusted (c) boxplots of EEG power spectra for autistic children. The dased red lines represent the detected outliers. The children highlighted in red and yellow have similar spectra with early PAF around 8 Hz but differ in age (126 vs. 34.2 months). The child depicted in purple is 98 months old and has a later PAF.

To study centrality of the autistic sample with respect to the neurotypical sample, we further employ cross-sample and covariate-adjusted Wasserstein boxplots and begin with studying the development shift in PAF values with age in both diagnostic groups with the Fréchet regression of spectra on age. Figures 4a and 4b display fitted spectra in each diagnostic group as a function of age (with lighter pink to darker violet tones signaling transition from younger to older children). The fitted spectra clearly illustrate the developmental shift in PAF to higher frequencies in the neurotypical group (Figure 4b), where this trend is absent in the autistic group (Figure 4a).

Figure 4:

Figure 4:

(a-b) Conditional Fréchet mean of power spectra for autistic (a) and neurotypical (b) children across different ages. (c) Fréchet regression residuals of autistic children color coded by age.

To depict differences in rankings of autistic children from the three different Wasserstein boxplots, we highlight three children (in red, yellow and purple) in the three Wasserstein boxplots given in Figure 3. The two children in red and yellow have similar power spectra with early PAF around 8 Hz and differing ages (126 months vs. 34.2 months old, respectively). The child depicted in purple has a markedly different power spectrum than the two children depicted in red and yellow, with a much later PAF and is identified as an outlier in the within-sample Wasserstein boxplot of the autistic sample. In the within-sample boxplot, the two children with similar spectra and early PAF rank similarly (23 and 20 out of 58 for red and yellow), where their rankings increase in the cross-sample boxplot (38 and 28 out of 58 for red and yellow), signaling moving away from the center when compared to the neurotypical sample with higher PAF values. In contrast, the autistic child given in purple with higher PAF is peripherial (rank 55 out of 58) but no longer an outlier (moving closer to the center) when compared to the neurotypical sample with higher PAF values in the cross-sample Wasserstein boxplot of the autism group given in Figure 3b. Finally, the cross-sample Wasserstein boxplot for autism identifies a median density with a higher PAF, similar to the neurotypical within-sample Wasserstein boxplot, along with one outlier autistic child with a very early PAF.

When the three autistic children are compared to their Fréchet mean in the neurotypical sample conditional on their age, only the child depicted in red has a Fréchet residual outside of the 75% central envelope of all residuals shown in Figure 3c. Covariate-adjusted Wasserstein boxplot provides a summary of the deviation of autistic spectra from their age predicted Fréchet mean, obtained from optimal transport moving mass from CDF of the observed spectra to the CDF of the Fréchet mean, thought of as a Fréchet residual. These individual Fréchet residuals are visualized in Figure 4c, color-coded by age, demonstrating an apparent age-related pattern in the deviation of observed spectra from their predicted Fréchet mean. In the covariate-adjusted boxplot (Figure 3c), the autistic child depicted in red has an early PAF compared to what would be predicted for his/her age at 126 months, resulting in a positive Fréchet residual, signaling moving of the CDF to the right to align with the Fréchet mean. In contrast, children depicted in yellow with the early PAF has a Fréchet residual within the 75% central envelope, signaling not a major deviation from their PAF predicted at the younger age of 34.2. Similarly, the autistic child depicted in purple with a later PAF is also found not to deviate from their age-predicted spectra (at age 98 months) beyond the 75% central envelope. Hence, although the child is found to be an outlier with a late PAF when compared to the autistic sample and is peripheral in the cross-sample Wasserstein boxplot, they are not an outlier in terms of their deviation from their age-predicted spectra in neurotypical development. In this data example, where there is a clear correlation between age and EEG power spectra (and more specifically PAF) in neurotypical development, age-adjusted Wasserstein boxplots provide the most detailed information on centrality and deviation of the autistic children from their expected spectra under neurotypical development. This analysis highlights different insights to be gained from the use of different Wasserstein boxplots in summary of centrality for the autistic sample. Skewness adjustment is not utilized in construction of the Wasserstein boxplots, as the raw centrality scores are not found to be skewed in analysis.

5. Simulation Studies

Extensive simulation studies are conducted to study the finite sample properties of the proposed Wasserstein boxplots in terms of outlier detection under different scenarios. Comparisons were made with five existing functional data outlier identification methods, including the modified band depth (MBD),9 extremal depth (ED),11 the outliergram (OG),5 total variation depth (TVD) combined with modified shape similarity,29 and magnitude-shape plot based on directional outlyingness (DO),30 with findings summarized in Section 5.1. Section 5.2 reports on findings from additional simulations on the feasibility of the covariate-adjusted Wasserstein boxplots to summarize deviations from the conditional Fréchet mean. Section 5.1 considers three simulation scenarios: (1) Gaussian densities with mean- and variance-based contamination, (2) Gaussian densities transported by different transport maps, and (3) Gaussian densities transported with transport maps under symmetric and asymmetric scaling. All three scenarios share a common initial data generation scheme with sampling from a set of Gaussian densities. However, while the first scenario considers mean- and variance-based contamination within a Gaussian framework, second and third scenarios study outlier detection in non-Gaussian settings where Gaussian densities are transformed with different transport maps. Note that all outliers are shape outlier in the context of densities, as any increase in mass in one region must be compensated by a decrease elsewhere due to the inherent constraint of integrating to 1.

5.1. Outlier detection

Outlier detection with the proposed Wasserstein boxplots are assessed under three simulation scenarios with a common baseline data generation model. All three simulation scenarios begin by generating 100 Gaussian densities X∼Nμ,σ2 with μ∼Nμ0,v1, σ∼Gamσ02/v2,v2/σ0, μ0=0, v1=0.02, σ0=2, and v2=0.01. All densities are evaluated on a common numerical grid over the interval [−10, 10], which is sufficiently wide to cover the effective support of all typical observations and outliers across the three simulation scenarios. We report from simulations using 100 grid points and note that results are found to be robust to the number of grid points used and that Wasserstein boxplots remain effective with coarser grids with 50 grid points in sensitivity analysis.

5.1.1. Scenario 1: Gaussian densities with mean- and variance-based contamination

In the first simulation scenario, outliers are introduced by generating 5% and 10% of the sample using μ0′=−0.5 (mean contamination), or σ0′=3 (variance contamination). A mixture of mean- and variance-based contamination is also considered, where outliers are generated as a mean or a variance outlier with equal probability. Table 1 summarizes the outlier-detection performance of the proposed Wasserstein boxplots (with and without skewness adjustment) as well as those of five comparative methods from 500 Monte Carlo runs. More specifically, the number of total detected outliers, the true positive rate (TPR) (proportion of correctly identified outliers), and the false positive rate (FPR) (proportion of non-outliers incorrectly flagged as an outlier) are reported under different contamination types (mean, variance, and mixture) and levels (5% vs. 10%).

Table 1:

Outlier Detection Performance (Mean (SD) from 500 Monte Carlo runs)

WB WB-S MBD ED OG TVD DO
Scenario 1: Mean Outliers
5% Detected 8.6 (2.4) 5.4 (1.4) 6.4 (2.4) 5.3 (2.2) 1.3 (1.0) 9.4 (2.5) 14.1 (3.7)
TPR (%) 90.6 (12.7) 82.4 (17.3) 30.4 (21.6) 33.9 (22.5) 24.6 (19.7) 62.5 (24.8) 83.4 (17.2)
FPR (%) 4.3 (2.4) 1.3 (1.1) 5.1 (2.2) 3.8 (1.9) 0.0 (0.2) 6.6 (2.4) 10.5 (3.8)
10% Detected 12.0 (2.4) 8.0 (1.8) 6.6 (2.6) 5.7 (2.4) 1.3 (1.1) 10.4 (3.0) 16.6 (3.9)
TPR (%) 85.8 (11.8) 71.8 (13.8) 23.4 (14.8) 22.3 (14.9) 12.5 (10.6) 52.8 (20.3) 76.7 (15.0)
FPR (%) 3.8 (2.2) 0.9 (1.0) 4.7 (2.2) 3.9 (2.0) 0.0 (0.2) 5.7 (2.3) 9.9 (3.7)
Scenario 1: Variance Outliers

5% Detected 9.2 (2.4) 6.3 (1.1) 8.9 (1.8) 7.0 (1.4) 0.1 (0.3) 10.2 (2.0) 14.7 (3.5)
TPR (%) 100.0 (0.0) 100.0 (0.0) 100.0 (0.0) 100.0 (0.0) 1.1 (5.8) 100.0 (0.0) 100.0 (0.0)
FPR (%) 4.4 (2.5) 1.3 (1.1) 4.1 (1.9) 2.1 (1.5) 0.0 (0.2) 5.4 (2.1) 10.3 (3.6)
10% Detected 12.9 (1.9) 10.6 (0.8) 12.2 (1.4) 10.5 (0.8) 0.0 (0.2) 12.8 (1.5) 17.8 (3.3)
TPR (%) 100.0 (0.0) 100.0 (0.0) 100.0 (0.0) 100.0 (0.0) 0.3 (2.0) 100.0 (0.0) 100.0 (0.0)
FPR (%) 3.2 (2.1) 0.7 (0.8) 2.4 (1.6) 0.5 (0.8) 0.0 (0.0) 3.2 (1.7) 8.7 (3.6)
Scenario 1: Mean and Variance Outliers

5% Detected 8.9 (2.2) 6.0 (1.3) 7.5 (2.2) 6.3 (2.0) 0.7 (0.8) 9.8 (2.4) 14.3 (3.5)
TPR (%) 95.8 (9.3) 91.9 (12.4) 64.4 (22.3) 67.8 (22.6) 13.8 (15.3) 80.8 (19.4) 91.8 (12.8)
FPR (%) 4.4 (2.3) 1.4 (1.2) 4.5 (2.1) 3.1 (1.8) 0.0 (0.2) 6.0 (2.4) 10.2 (3.7)
10% Detected 12.5 (2.2) 9.4 (1.4) 9.6 (2.1) 8.4 (1.9) 0.7 (0.8) 11.6 (2.1) 17.6 (3.5)
TPR (%) 94.1 (7.8) 86.9 (11.7) 61.8 (15.6) 64.6 (16.9) 7.0 (8.4) 75.2 (15.1) 89.7 (10.9)
FPR (%) 3.4 (2.2) 0.7 (0.9) 3.8 (1.9) 2.1 (1.6) 0.0 (0.1) 4.5 (2.0) 9.6 (3.6)
Scenario 2

5% Detected 9.1 (2.3) 6.2 (1.1) 18.0 (3.4) 13.5 (3.4) 0.9 (1.3) 18.5 (3.0) 30.0 (3.8)
TPR (%) 100.0 (0.0) 100.0 (0.0) 95.8 (18.8) 100.0 (0.0) 6.8 (11.7) 99.6 (5.6) 100.0 (0.0)
FPR (%) 4.3 (2.5) 1.3 (1.1) 13.9 (3.2) 8.9 (3.6) 0.6 (1.0) 14.3 (3.2) 26.3 (4.0)
10% Detected 12.9 (2.0) 10.7 (0.8) 16.9 (5.8) 13.7 (6.0) 1.0 (1.3) 21.1 (3.9) 33.7 (3.4)
TPR (%) 100.0 (0.0) 100.0 (0.0) 53.8 (44.6) 71.4 (44.4) 5.0 (7.3) 90.7 (23.2) 100.0 (0.0)
FPR (%) 3.2 (2.2) 0.7 (0.9) 12.8 (3.1) 7.3 (3.1) 0.6 (0.9) 13.4 (3.1) 26.4 (3.7)
Scenario 3

Symmetric (10%) Detected 12.5 (2.3) 10.0 (0.7) 7.6 (2.6) 5.9 (2.5) 3.1 (2.0) 10.1 (2.2) 36.0 (8.2)
TPR (%) 100.0 (0.6) 98.0 (4.8) 65.0 (21.0) 41.0 (19.2) 30.4 (19.8) 85.4 (13.8) 69.0 (20.4)
FPR (%) 2.8 (2.6) 0.2 (0.5) 1.3 (1.5) 2.0 (1.6) 0.0 (0.1) 1.7 (1.9) 32.3 (10.6)
Asymmetric (10%) Detected 12.2 (2.1) 10.2 (0.4) 5.1 (2.7) 3.8 (2.1) 0.6 (1.0) 5.9 (3.0) 27.9 (10.0)
TPR (%) 100.0 (0.0) 99.9 (1.2) 42.2 (24.0) 22.4 (15.1) 4.9 (8.8) 43.5 (24.4) 99.1 (4.1)
FPR (%) 2.4 (2.4) 0.2 (0.5) 0.9 (1.2) 1.7 (1.4) 0.1 (0.3) 1.7 (1.8) 20.0 (11.0)

Note: WB = Wasserstein Boxplot, WB-S = Skewness-adjusted Wasserstein boxplot, MBD = Modified Band Depth, ED = Extremal Depth, OG = Outliergram, TVD = Total Variation Depth, DO = Directional Outlyingness; TPR = True Positive Rate, FPR = False Positive Rate.

The Wasserstein boxplots (WB) demonstrate robust TPR (≥ 85%) and low FPR (≤ 5%) values across the three contamination types, signaling effective identification of outliers, while the skewness-adjusted Wasserstein boxplots (WB-S) are more sensitive to the level of outliers generated, further reducing overdetection and leading to even tighter control of FPR (≤ 1.5%) at the expense of slightly lower TPR values (≥ 70%). Hence, the skewness-adjusted Wasserstein boxplots provide a valuable option when controlling overdetection is a priority.

In contrast, the five comparator functional data outlier detection methods exhibit different limitations. MBD and ED, which depend on the relative position (depth) of a curve, prove effective for variance outliers (high TPR and low FPR) but show poor sensitivity to mean (TPR < 34%) and mixture (TPR ≤ 68%) outliers. Variance outliers are detected effectively because the increased variance flattens the central region and widens the distribution. Consequently, the variance outlier may lie outside the typical range not only in tails but also in the center. However, a global mean shift could still occupy a central position over most of the domain due to the variability in sampling of the mean and variance of the Gaussian distributions.

The OG exhibits the lowest TPR across all types of outliers, detecting the least amount of outliers in general (performance worst for variance outliers), as it is a conservative method designed for shape outliers using the theoretical parabolic relationship between the modified epigraph index (MEI) and MBD. MEI measures the mean proportion of time that the target curve lies below all curves in the sample. In the simulation, Gaussian variance outliers spend less than 30% of the domain below the bulk of the sample and lie above the remaining curves for most of the domain due to their heavy tails. As a result, these curves have low MEI values and are not identified as shape outliers, even though they exhibit low MBD. TVD improves sensitivity to mean outliers relative to MBD and ED by incorporating local shape and variability information. However, as a non-distance-based method that remains focused on relative coverage, its TPR for outlier detection is consistently lower than those of proposed Wasserstein distance-based approaches.

Among the comparator methods, DO performs the best, mostly due to its distance-based nature. However, DO is prone to overflagging outliers, showing a significantly higher FPR. Its trade-off between sensitivity and specificity is suboptimal compared to the Wasserstein boxplot, as evidenced by its lower TPR in both mean and mixture outlier scenarios. This is potentially due to its aggregation of pointwise directional distances compared to the global approach of the proposed Wasserstein boxplots treating densities in their entirety as a data object.

5.1.2. Scenario 2: Gaussian densities transported by different transport maps

The second simulation scenario transports generated Gaussian densities using the transport scheme Tk:[0,1]→[0,1], defined as Tk(u)=u−sin⁡(kπu)/|kπ|,u∈[0,1], for k∈Z∖{0}.34 Tk acts as a monotone quantile deformation map that redistributes probability mass. Let F denote the CDF of the original base density. The transported distribution is defined such that its quantile function satisfies Ftrans−1(u)=F−1Tk(u) for u∈[0,1]. Equivalently, the CDF function transforms as Ftrans(x)=Tk−1(F(x)). In this simulation set-up, while the sample is transported with the map corresponding to k = 3 (Figure 5a), yielding a bimodal density, outliers are generated by applying the transport map corresponding to k = 1, resulting in a unimodal density (Figure 5b).

Figure 5:

Figure 5:

(a) Transport maps Tk (u) used in transportion of the Gaussian CDFs in simulation scenario 2 (the sample and the outliers are transported with k = 3, k = 1, respectively). (b) Resulting sample of densities (blue) and 10% outliers (red). (c-d) Wasserstein (c) and functional boxplot based on MBD (d) from a Monte Carlo run with 10% outliers.

For the case of 5% outliers, WB, WB-S, ED, TVD, and DO achieve 100% or nearly 100% TPR, while MBD yields a lower (95.8%) and OG substantially lower (6.8%) TPR. In terms of FPR, WB attains lower values than all comparator methods except OG, which barely flags any outliers, and WB-S achieves even lower FPR as expected (see Table 1). In the case of 10% outliers, the TPR values of MBD and ED drop to 53.8% (with standard deviation of 44.6%) and 71.4% (with standard deviation of 44.4%), respectively, whereas WB and WB-S maintain 100% TPR. Furthermore, MBD and ED continue to show higher FPR values compared to the Wasserstein boxplots. This confirms that there is substantial variability in MBD and ED formed across different Monte Carlo runs in the case of 10% outliers. In some runs outliers are falsely ranked as high as the top 50% of the sample in the functional boxplot based on MBD or ED, contributing to the shape of the 50% central envelope and to underdetection of true positives, leading to a lower TPR value (an example of a MBD functional boxplot with wider 50% central envelope is given in Figure 5d). This is because both MBD and ED assess centrality based on relative ordering rather than distance, with MBD based on average inclusion of a curve within pairwise pointwise bands of the rest of the sample and ED prioritizes the extremeness of pointwise depth distributions. The unimodal outliers overlap with the bimodal sample in the right tail of the distribution for roughly 1/3 of the range of the support. As the percent of outliers increase in the sample, this overlap helps the outliers reach the threshold for ranking within the top 50% of the sample on some runs. In other runs, the 50% centrality envelope for the functional boxplots are very tight, representing the bimodal sample. However, due to detection of outliers beyond a multiplier of pointwise IQR from the central envelope, more observations are classified as an outlier, contributing to the high FPR values.

The OG detects very few outliers in both the 5% and 10% cases (on average about one outlier in a sample of size 100), resulting in both low TPR and FPR. TVD exhibits improved TPR compared with MBD and ED in both contamination settings (greater than 90%), as it incorporates composition associated with shape and magnitude outlyingness. However, it achieves lower TPR and higher FPR than that of the Wasserstein boxplots, reflecting suboptimal sensitivity due its dependence on relative overlap. Although DO achieves 100% TPR under both contamination levels, it exhibits consistently highest FPR of over 26%, as it detects much more outliers than expected, which aligns with the results in Scenario 1. Similar to the intuition from the first scenario, Wasserstein boxplots are able to detect outliers much more effectively (see Figure 5c), utilizing quantification of total mass transport in aligning distance profiles of the unimodal densities with those from the bimodal sample. In addition, Wasserstein boxplots do not rely on pointwise detection of outliers, they use centrality scores, treating densities as random objects, which leads to more robust outlier detection results.

5.1.3. Scenario 3: Gaussian densities transported with transport maps under symmetric and asymmetric scaling

The third scenario considers outliers introduced in scaling of transport maps applied to the generated Gaussian densities. Scaling is introduced according to the scalar multiplication operations rule in the transport space 𝒯,35 by multiplying the transport map T(u) by α∈(−1,1),

α⊙T(u):=u+α(T(u)−u),0<α≤1,u,α=0,u+αu−T−1(u),−1≤α<0,

where the base transport map T(u) equals u−sin⁡(−πu)/π corresponding to the case k = 1 in the previously introduced transport scheme of.34 Figure 6a displays a sample of resulting transport maps α ⊙ T(u) where α’s are sampled from the uniform distribution U (−0.5, 0.5) for generation of the sample and are set to {−1, 1} in equal proportion for the generation of the 10% outliers with symmetric scaling. Figure 6c depicts the corresponding probability densities with outliers corresponding to α = 1 given in deep red and α = −1 given in deep blue obtained by applying these maps to the baseline Gaussian distributions. While scaling with α = 1 generates a density shifted to the left of the sample with lower variance, scaling with α = −1 corresponds to a density shifted to the right of the sample with higher variance. Generation of outliers with asymmetric scaling only generates outliers using α = −1 where Figures 6b and 6d display the corresponding transport maps and densities, respectively. The 10% outliers, corresponding to α = −1 all fall to the right of the sample with higher variance depicted in dark blue in Figure 6d.

Figure 6:

Figure 6:

(a-b) Transport maps α ⊙ T (u) used for generation of the sample in simulation scenario 3 with outliers generated from symmetric (a) and asymmetric scaling (b). (c-d) Resulting sample of densities color-coded by α with 10% outliers. Outliers generated with α = 1 and −1 are depicted in red and blue, respectively. (e-j) Wasserstein boxplots (e-f), skewness-adjusted Wasserstein boxplots (g-h), and functional boxplots based on MBD (i-j) for densities with outliers generated with symmetric (left column) and asymmetric (right column) scaling of transport maps.

Figures 6 (e–j) display Wasserstein (6e and 6f), skewness-adjusted Wasserstein (6g and 6h) and functional boxplots based on MBD (6i and 6j) for outliers from symmetric (left column) and asymmetric (right column) scaling, respectively. In addition, Table 1 summarizes the outlier-detection performance for Wasserstein boxplots and all comparative methods for symmetric and asymmetric scaling with 10% outliers based on 500 Monte Carlo runs. The Wasserstein boxplot consistently achieves 100% TPR in both settings (symmetric, asymmetric scaling) while maintaining a false positive rate of under 3%. The skewness-adjusted Wasserstein boxplot further enhances performance by effectively reducing false positives reducing FPR to 0.2%, while retaining a high TPR (greater than 98%) in both settings, similar to findings from previous simulation scenarios.

In contrast, the comparator methods exhibit significant sensitivity to the scaling structure. In the symmetric setting, MBD yields a moderate average TPR of 65.0%, significantly lower than TPR achieved by Wasserstein boxplots. However, this performance further declines in the asymmetric setting, showing an over 20% average drop with TPR at 42.2%. A similar trend is observed for ED and TVD in the asymmetric setting. The TPR for ED falls from 41.0% to 22.4%, and TVD sees a drastic decline from 85.4% to 43.5%. They fail to detect a significant percent of outliers in the asymmetric case due to their non-distance based nature, where curves are ranked based on relative location. Hence, curves on the periphery are consistently flagged as extreme, regardless of the magnitude of their deviation from the center. In other words, as long as the mutual position of the curves remain unchanged, local expansions or contractions in any portion of the curves barely affect their MBD, ED, or TVD values. As a result, the MBD, ED, and TVD overlook distributional asymmetry in scaling of transport functions, causing outliers to appear peripheral but within the normal range, reducing outlier detection accuracy. In contrast, the Wasserstein boxplot employing a distance-based approach is inherently sensitive to absolute deviations from the center and is able to achieve consistently high outlier detection accuracy in both symmetric and asymmetric scaling of transport functions.

The OG achieves a TPR of 30.4% in the symmetric setting, which is its highest TPR across all scenarios. This occurs because all outliers have a modified epigraph index (MEI) close to 0.5, where MEI measures the average proportion of time that a target curve lies below the other curves in the sample. In this setting, the outliers spend approximately half of the domain above and half below the bulk of the sample. An MEI value near 0.5 would typically correspond to a high MBD due to the theoretical MEI–MBD relationship. However, the MBD values of these outliers are low because they are more frequently on the periphery of the sample. In the asymmetric setting, the TPR of OG drops to 4.9% as the increased MBD of the outliers places them closer to the theoretical parabola. Notably, unlike MBD, ED, TVD, and OG, which exhibit significant drop in TPR for the asymmetric setting, the magnitude-shape plot based on DO shows higher TPR in the asymmetric setting (99.1%) compared with that of symmetric setting (69.0%). However the average FPR is consistently high for DO, as it continues to detect a large proportion of outliers similar to other simulation scenarios.

5.2. Covariate-adjusted residual analysis

We also design simulations to study the feasibility of the covariate-adjusted Wasserstein boxplots to summarize deviations from the conditional Fréchet mean with the use of Fréchet regression residuals. To be able to visualize the Fréchet residuals (representing shifts in quantiles in aligning the CDF of a density to the CDF of the conditional Fréchet mean) on a compact support, 50 densities are simulated from a truncated normal density defined on the support [−10, 10]. More specifically, n = 50 samples of paired data (ai, zi) are generated as follows: the covariate ai is sampled from 𝒰(−1,1), and zi is generated from the truncated normal density function fTN(v),

fTNv=ϕv−μiσiσiΦ10−μiσi−Φ−10−μiσi,v∈−10,10,

where the covariate-dependent mean and variance equal μi=2ai+εμ and σi=3+ai+εσ, with random fluctuations εμ∼𝒩(0,1.5) and εσ∼Gamma(5,0.3). In the above expression, ϕ(⋅) and Φ(⋅) represent the standard normal PDF and CDF, respectively. Figure 7a displays a sample of simulated truncated normal densities that are dependent on covariate a.

Figure 7:

Figure 7:

(a) Sample of simulated truncated normal densities that are dependent on covariate a. (b) Transport maps α⊙Tk(u) with k = −1, scaled by varying α values used in tranportation of CDFs. (c) Resulting sample of densities color-coded by α. (d-e) Fréchet regression residuals color-coded by α (c) and covariate a (e). (f) Boxplot of Fréchet regression residuals.

Next, the generated densities are transported via the family of random transport maps α⊙Tk(u), where α is generated from 𝒰(−1,1),Tk(u)=u−sin⁡(kπu)/|uπ|, u∈[0,1], and k=−1. By transporting covariate-dependent densities with covariate-independent transport deformations, we can evaluate the covariate-adjusted boxplot’s effectiveness in adjusting for covariate effects using Fréchet regressions and summarizing the remaining, covariate-independent deviations in the data via Fréchet regression residuals. The transport maps corresponding to k = −1 for varying α values and the resulting transported sample of densities are given in Figures 7b and 7c, respectively.

Following Fréchet regression of the transported densities on the covariate a, Figures 7d and 7e display Fréchet regression residuals, representing the optimal transport maps moving mass from the observed samples zi to the conditional Fréchet mean m⊕ai, as a function of transport scaling coefficient α and covariate a, respectively. More specifically, the Fréchet residuals are obtained as Hm⊕ai,zi(v)=Fm⊕ai−1Fzi(v)−v, where Fm⊕ai−1 denotes the quantile function of the conditional Fréchet mean of z given ai , and Fzi denotes the CDF of the observed density zi . Figures 7d and 7e show that while the covariate effects are effectively removed by the Fréchet regression (residuals do not display a discernible pattern in a), the Fréchet residuals are able to capture the remaining deviations in the data induced by scaled transport maps (residuals capturing differences across the scaling constant α). Positive residuals (red/orange) indicate rightward shifts to align with the covariate-adjusted mean (as positive α moves mass left), while negative residuals (blue/green) indicate leftward shifts to align with the Fréchet mean (Figure 7e). Note that this pattern mirrors the patterns observed in our data analysis, with positive residuals representing subjects with earlier PAFs for their age in neurotypical development, hence a rightward shift in aligning with the covariate-adjusted Fréchet mean, while negative residuals represented leftward shifts in aligning with conditional Fréchet means. Finally, Figure 7f displays the covariate-adjusted boxplot that succinctly summarize the symmetric spread of deviations induced on the truncated densities by scaled transport maps.

6. Discussion

We proposed Wasserstein boxplots that take into account inherent constraints of densities by moving to the 2-Wasserstein metric space in capturing centrality and spread among a sample of densities. Motivated by our data application on characterization of subject-specific deviations in the autism group from neurotypical development, proposals are extended to contrastive settings with a target and a reference group, via cross-sample and covariate-adjusted Wasserstein boxplots. These developments are able to quantify centrality of a target density from a reference sample or quantify deviation of a target density from their covariate-adjusted Fréchet mean in the reference sample.

Beyond applications to modeling EEG power spectra, the Wasserstein boxplots are broadly applicable to other density-valued objects. Examples include age-at-death distributions of human mortality across countries or years,22, 27 density functions of daily confirmed cases of COVID-19 for each state over a specific time interval,36 BMI distributions across different demographic cohorts,37 and annual temperature distributions where each year represents an observation.35 In addition, contrastive settings can include a target and a reference group which can represent treatment and placebo or even densities obtained before or after treatment within the same sample in clinical research.

Finally, an interesting topic for future research would be extension of developments to other data objects (e.g. multivariate densities, correlation matrices) in non-Euclidean metric spaces. While visualization of the centrality and spread of the sample of data objects from higher-dimensions would require innovative solutions, note that developments based on optimal transport of distance profiles (e.g. within- and cross-sample boxplots) would scale up computationally to ranking of other data objects from higher-dimensions. An important advantage of basing developments on distance profiles is that regardless of the dimension of the data object considered, the proposed approach anchors the problem back to ranking of distance profiles which are themselves two-dimensional densities which is a more computationally feasible approach than ranking of the data objects from higher dimensions directly.

Funding Information

This work was supported by National Institute of Mental Health R01 MH122428 (DS, DT, SJ).

Data Availability Statement

The code and documentation for implementing the proposed methodology on simulated datasets are provided on Github at https://github.com/dsenturk/WB-plot.

References

  • [1].Hyndman RJ, Shang HL. Rainbow Plots, Bagplots, and Boxplots for Functional Data. J Comput Graph Stat. 2010;19(1):29–45. doi: 10.1198/jcgs.2009.08158 [DOI] [Google Scholar]
  • [2].Febrero M, Galeano P, González-Manteiga W. Outlier detection in functional data by depth measures, with application to identify abnormal NOx levels. Environmetrics. 2008;19(4):331–345. [Google Scholar]
  • [3].Sun Y, Genton MG. Functional boxplots. J Comput Graph Stat. 2011;20(2):316–334. [Google Scholar]
  • [4].Gervini D Outlier detection and trimmed estimation for general functional data. Stat Sinica. 2012;22(4):1639–1660. [Google Scholar]
  • [5].Arribas-Gil A, Romo J. Shape outlier detection and visualization for functional data: the outliergram. Biostatistics. 2014;15(4):603–619. doi: 10.1093/biostatistics/kxu006 [DOI] [PubMed] [Google Scholar]
  • [6].Tukey JW. Mathematics and the picturing of data. In: Proceedings of the International Congress of Mathematicians. Vol 2. Montreal: Canadian Mathematical Congress; 1975. p. 523–531. [Google Scholar]
  • [7].Liu RY. On a Notion of Data Depth Based on Random Simplices. Ann Stat. 1990;18(1):405–414. doi: 10.1214/aos/1176347507 [DOI] [Google Scholar]
  • [8].Cuevas A, Fraiman R. On Depth Measures and Dual Statistics: A Methodology for Dealing with General Data. J Multivar Anal. 2009;100(4):753–766. doi: 10.1016/j.jmva.2008.08.003 [DOI] [Google Scholar]
  • [9].López-Pintado S, Romo J. On the Concept of Depth for Functional Data. J Am Stat Assoc. 2009;104(486):718–734. doi: 10.1198/jasa.2009.0108 [DOI] [Google Scholar]
  • [10].López-Pintado S, Romo J. A half-region depth for functional data. Comput Stat Data Anal. 2011;55(4):1679–1695. doi: 10.1016/j.csda.2010.10.024 [DOI] [Google Scholar]
  • [11].Narisetty NN, Nair VN. Extremal depth for functional data and applications. J Am Stat Assoc. 2016;111(516):1705–1714. doi: 10.1080/01621459.2015.1110033 [DOI] [Google Scholar]
  • [12].Cuevas A, Febrero M, Fraiman R. On the use of the bootstrap for estimating functions with functional data. Comput Stat Data Anal. 2006;51(2):1063–1074. doi: 10.1016/j.csda.2005.10.005 [DOI] [Google Scholar]
  • [13].Long JP, Huang JZ. A Study of Functional Depths. arXiv preprint arXiv:1506.01332. 2015. [Google Scholar]
  • [14].Dai W, Genton MG. Directional outlyingness for multivariate functional data. Comput Stat Data Anal. 2019;131:50–65. doi: 10.1016/j.csda.2018.09.005 [DOI] [Google Scholar]
  • [15].Dickinson A, DiStefano C, Senturk D, Jeste SS. Peak alpha frequency is a neural marker of cognitive function across the autism spectrum. Eur J Neurosci. 2018;47(6):643–651. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [16].Miskovic V, Ma X, Chou CA, et al. Developmental changes in spontaneous electrocortical activity and network organization from early to late childhood. NeuroImage. 2015;118:237–247. doi: 10.1016/j.neuroimage.2015.06.013 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [17].Edgar JC, Dipiero M, McBride E, et al. Abnormal maturation of the resting-state peak alpha frequency in children with autism spectrum disorder. Hum Brain Mapp. 2019;40(11):3288–3298. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [18].Scheffler AW, Dickinson A, DiStefano C, Jeste S, Şentürk D. Covariate-adjusted hybrid principal components analysis for region-referenced functional EEG data. Stat Its Interface. 2022;15(2):209. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [19].Scheffler AW, Telesca D, Sugar CA, et al. Covariate-adjusted region-referenced generalized functional linear model for EEG data. Stat Med. 2019;38(30):5587–5602. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [20].Marron JS, Alonso AM. Overview of object oriented data analysis. Biom J. 2014;56(5):732–753. [DOI] [PubMed] [Google Scholar]
  • [21].Faraway JJ. Regression for non-Euclidean data using distance matrices. J Appl Stat. 2014;41(11):2342–2357. doi: 10.1080/02664763.2014.909794 [DOI] [Google Scholar]
  • [22].Petersen A, Müller HG. Fréchet regression for random objects with Euclidean predictors. Ann Stat. 2019;47(2):691–719. [Google Scholar]
  • [23].Zemel Y, Panaretos VM. Fréchet means and Procrustes analysis in Wasserstein space. Bernoulli. 2019;25(2):932–976. doi: 10.3150/17-BEJ1009 [DOI] [Google Scholar]
  • [24].Chen Y, Lin Z, Müller HG. Wasserstein regression. J Am Stat Assoc. 2023;118(542):869–882. [Google Scholar]
  • [25].Okano R, Imaizumi M. Distribution-on-distribution regression with Wasserstein metric: Multivariate Gaussian case. J Multivar Anal. 2024;203:105334. [Google Scholar]
  • [26].Villani C Optimal Transport: Old and New. Berlin: Springer; 2008. Grundlehren der mathematischen Wissenschaften, Vol. 338. [Google Scholar]
  • [27].Dubey P, Chen Y, Müller HG. Metric statistics: Exploration and inference for random objects with distance profiles. Ann Stat. 2024;52(2):757–792. doi: 10.1214/24-AOS2368 [DOI] [Google Scholar]
  • [28].Ambrosio L, Gigli N, Savaré G. Gradient flows: in metric spaces and in the space of probability measures. Springer Science & Business Media; 2008. [Google Scholar]
  • [29].Huang H, Sun Y. A decomposition of total variation depth for understanding functional outliers. Technometrics. 2019;61(4):445–458. doi: 10.1080/00401706.2019.1574241 [DOI] [Google Scholar]
  • [30].Dai W, Genton MG. Multivariate functional data visualization and outlier detection. J Comput Graph Stat. 2018;27(4):923–934. doi: 10.1080/10618600.2018.1473781 [DOI] [Google Scholar]
  • [31].Fréchet M Les éléments aléatoires de nature quelconque dans un espace distancié. Annales de l’institut Henri Poincaré. 1948;10(4):215–310. [Google Scholar]
  • [32].Brys G, Hubert M, Struyf A. A Robust Measure of Skewness. J Comput Graph Stat. 2004;13(4):996–1017. [Google Scholar]
  • [33].Hubert M, Vandervieren E. An adjusted boxplot for skewed distributions. Comput Stat Data Anal. 2008;52(12):5186–5201. doi: 10.1016/j.csda.2007.11.008 [DOI] [Google Scholar]
  • [34].Panaretos VM, Zemel Y. Amplitude and phase variation of point processes. Ann Stat. 2016;44(2):771–812. doi: 10.1214/15-AOS1387 [DOI] [Google Scholar]
  • [35].Zhu C, Müller HG. Autoregressive optimal transport models. J R Stat Soc B. 2023;85(3):1012–1033. doi: 10.1093/jrsssb/qkad051 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [36].Gajardo Á, Müller HG, Zhou H. Wasserstein–Fréchet integration of conditional distributions. Electron J Stat. 2025;19(1):1722–1783. [Google Scholar]
  • [37].Zhou Y, Müller HG. Wasserstein regression with empirical measures and density estimation for sparse data. Biometrics. 2024;80(4):ujae127. doi: 10.1093/biomtc/ujae127 [DOI] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

The code and documentation for implementing the proposed methodology on simulated datasets are provided on Github at https://github.com/dsenturk/WB-plot.

RESOURCES