Distributional data analysis

Distributional data analysis is a branch of nonparametric statistics that is related to functional data analysis. It is concerned with random objects that are probability distributions, i.e., the statistical analysis of samples of random distributions where each atom of a sample is a distribution. One of the main challenges in distributional data analysis is that although the space of probability distributions is a convex space, it is not a vector space.

Notation
Let $$\nu$$ be a probability measure on $$D$$, where $$D \subset \R^p$$ with $$p \ge 1$$. The probability measure $$\nu$$ can be equivalently characterized as cumulative distribution function $$F$$ or probability density function $$f$$ if it exists. For univariate distributions with $$p = 1$$, quantile function $$Q=F^{-1}$$ can also be used.

Let $$\mathcal{F}$$ be a space of distributions $$\nu$$ and let $$d$$ be a metric on $$\mathcal{F}$$ so that $$(\mathcal{F}, d)$$ forms a metric space. There are various metrics available for $$d$$. For example, suppose $$\nu_1, \; \nu_2 \in \mathcal{F}$$, and let $$f_1$$ and $$f_2$$ be the density functions of $$\nu_1$$ and $$\nu_2$$, respectively. The Fisher-Rao metric is defined as $$ d_{FR}(f_1, f_2) = \arccos \left( \int_D \sqrt{f_1(x) f_2(x)} dx \right). $$

For univariate distributions, let $$Q_1$$ and $$Q_2$$ be the quantile functions of $$\nu_1$$ and $$\nu_2$$. Denote the $$L^p$$-Wasserstein space as $$\mathcal{W}_p$$, which is the space of distributions with finite $$p$$-th moments. Then, for $$\nu_1, \; \nu_2 \in \mathcal{W}_p$$, the $$L^p$$-Wasserstein metric is defined as $$ d_{W_p}(\nu_1, \nu_2) = \left( \int_0^1 [Q_1(s) - Q_2(s)]^p ds \right)^{1/p}. $$

Mean and variance
For a probability measure $$\nu \in \mathcal{F}$$, consider a random process $$\mathfrak{F}$$ such that $$\nu \sim \mathfrak{F}$$. One way to define mean and variance of $$\nu$$ is to introduce the Fréchet mean and the Fréchet variance. With respect to the metric $$d$$ on $$\mathcal{F}$$, the Fréchet mean $$\mu_\oplus$$, also known as the barycenter, and the Fréchet variance $$V_\oplus$$ are defined as $$\begin{align} \mu_\oplus &= \operatorname{argmin}_{\mu \in \mathcal{F}} \mathbb{E}[d^2(\nu, \mu)], \\ V_\oplus &= \mathbb{E}[d^2(\nu, \mu_\oplus)]. \end{align}$$

A widely used example is the Wasserstein-Fréchet mean, or simply the Wasserstein mean, which is the Fréchet mean with the $$L^2$$-Wasserstein metric $$d_{W_2}$$. For $$\nu, \; \mu \in \mathcal{W}_2$$, let $$Q_\nu, \; Q_\mu$$ be the quantile functions of $$\nu$$ and $$\mu$$, respectively. The Wasserstein mean and Wasserstein variance is defined as $$\begin{align} \mu_\oplus^* &= \operatorname{argmin}_{\mu \in \mathcal{W}_2} \mathbb{E} \left[ \int_0^1 (Q_\nu (s) - Q_\mu (s))^2 ds \right], \\ V_\oplus^* &= \mathbb{E} \left[ \int_0^1 (Q_\nu (s) - Q_{\mu_\oplus^*} (s))^2 ds \right]. \end{align}$$

Modes of variation
Modes of variation are useful concepts in depicting the variation of data around the mean function. Based on the Karhunen-Loève representation, modes of variation show the contribution of each eigenfunction to the mean.

Functional principal component analysis
Functional principal component analysis(FPCA) can be directly applied to the probability density functions. Consider a distribution process $$\nu \sim \mathfrak{F}$$ and let $$f$$ be the density function of $$\nu$$. Let the mean density function as $$\mu(t) = \mathbb{E}\left[f(t)\right]$$ and the covariance function as $$G(s,t) = \operatorname{Cov}(f(s), f(t))$$ with orthonormal eigenfunctions $$\{\phi_j\}_{j=1}^\infty$$ and eigenvalues $$\{\lambda_j\}_{j=1}^\infty$$.

By the Karhunen-Loève theorem, $$ f(t) = \mu(t) + \sum_{j=1}^\infty \xi_j \phi_j(t)$$, where principal components $$\xi_j = \int_D [f(t) - \mu(t)] \phi_j(t) dt$$. The $$j$$th mode of variation is defined as $$ g_{j}(t, \alpha) = \mu(t) + \alpha \sqrt{\lambda_j} \phi_j(t), \quad t \in D, \; \alpha \in [-A, A] $$ with some constant $$A$$, such as 2 or 3.

Transformation FPCA
Assume the probability density functions $$f$$ exist, and let $$\mathcal{F}_f$$ be the space of density functions. Transformation approaches introduce a continuous and invertible transformation $$\Psi: \mathcal{F}_f \to \mathbb{H}$$, where $$\mathbb{H}$$ is a Hilbert space of functions. For instance, the log quantile density transformation or the centered log ratio transformation are popular choices.

For $$f \in \mathcal{F}_f$$, let $$Y = \Psi(f)$$, the transformed functional variable. The mean function $$\mu_Y(t) = \mathbb{E}\left[Y(t)\right]$$ and the covariance function $$G_Y(s,t) = \operatorname{Cov}(Y(s), Y(t))$$ are defined accordingly, and let $$\{\lambda_j, \phi_j\}_{j=1}^\infty$$ be the eigenpairs of $$G_Y(s,t)$$. The Karhunen-Loève decomposition gives $$Y(t) = \mu_Y(t) + \sum_{j=1}^\infty \xi_j \phi_j(t)$$, where $$\xi_j = \int_D [Y(t) - \mu_Y(t)] \phi_j(t) dt$$. Then, the $$j$$th transformation mode of variation is defined as $$ g_{j}^{TF}(t, \alpha) = \Psi^{-1} \left( \mu_Y + \alpha \sqrt{\lambda_j}\phi_j \right)(t), \quad t \in D, \; \alpha \in [-A, A]. $$

Log FPCA and Wasserstein Geodesic PCA
Endowed with metrics such as the Wasserstein metric $$d_{W_2}$$ or the Fisher-Rao metric $$d_{FR}$$, we can employ the (pseudo) Riemannian structure of $$\mathcal{F}$$. Denote the tangent space at the Fréchet mean $$\mu_\oplus$$ as $$T_{\mu_\oplus}$$, and define the logarithm and exponential maps $$\log_{\mu_\oplus}:\mathcal{F} \to T_{\mu_\oplus}$$ and $$\exp_{\mu_\oplus}: T_{\mu_\oplus} \to \mathcal{F}$$. Let $$Y$$ be the projected density onto the tangent space, $$Y = \log_{\mu_\oplus}(f)$$.

In Log FPCA, FPCA is performed to $$Y$$ and then projected back to $$\mathcal{F}$$ using the exponential map. Therefore, with $$Y(t) = \mu_Y(t) + \sum_{j=1}^\infty \xi_j \phi_j(t)$$, the $$j$$th Log FPCA mode of variation is defined as $$g_j^{Log}(t, \alpha) = \exp_{f_\oplus} \left( \mu_{f_\oplus} + \alpha \sqrt{\lambda_j} \phi_j \right)(t), \quad t \in D, \; \alpha \in [-A, A].$$

As a special case, consider $$L^2$$-Wasserstein space $$\mathcal{W}_2$$, a random distribution $$\nu \in \mathcal{W}_2$$, and a subset $$G \subset \mathcal{W}_2$$. Let $$d_{W_2}(\nu, G) = \inf_{\mu \in G} d_{W_2}(\nu, \mu)$$ and $$K_{W_2}(G) = \mathbb{E}\left[d_{W_2}^2(\nu, G) \right]$$. Let $$\text{CL}(\mathcal{W}_2)$$ be the metric space of nonempty, closed subsets of $$\mathcal{W}_2$$, endowed with Hausdorff distance, and define $$ \operatorname{CG}_{\nu_0, k}(\mathcal{W}_2) = \{G \in \operatorname{CL}(\mathcal{W}_2) : \nu_0 \in G, G \text{ is a geodesic set s.t. }\operatorname{dim}(G) \le k \}, \; k \ge 1. $$ Let the reference measure $$\nu_0$$ be the Wasserstein mean $$\mu_\oplus$$. Then, a principal geodesic subspace (PGS) of dimension $$k$$ with respect to $$\mu_\oplus$$ is a set $$G_k = \operatorname{argmin}_{G \in \text{CG}_{\nu_\oplus, k}(\mathcal{W}_2)} K_{W_2}(G)$$.

Note that the tangent space $$T_{\mu_\oplus}$$ is a subspace of $$L^2_{\mu_\oplus}$$, the Hilbert space of $${\mu_\oplus}$$-square-integrable functions. Obtaining the PGS is equivalent to performing PCA in $$L^2_{\mu_\oplus}$$ under constraints to lie in the convex and closed subset. Therefore, a simple approximation of the Wasserstein Geodesic PCA is the Log FPCA by relaxing the geodesicity constraint, while alternative techniques are suggested.

Fréchet regression
Fréchet regression is a generalization of regression with responses taking values in a metric space and Euclidean predictors. Using the Wasserstein metric $$d_{W_2}$$, Fréchet regression models can be applied to distributional objects. The global Wasserstein-Fréchet regression model is defined as

which generalizes the standard linear regression.

For the local Wasserstein-Fréchet regression, consider a scalar predictor $$X\in \mathbb{R}$$ and introduce a smoothing kernel $$K_h(\cdot) = h^{-1}K(\cdot/h)$$. The local Fréchet regression model, which generalizes the local linear regression model, is defined as $$\begin{align} l_\oplus (x) &= \operatorname{argmin}_{\omega \in \mathcal{F}} \mathbb{E}\left[ s_L(X,x,h) d_{W_2}^2(\nu,\omega) \right],\\ s_L(X,x,h) &= \sigma_0^{-2} \{ K_h(X-x)[\mu_2 - \mu_1 (X-x)]\}, \end{align}$$ where $$\mu_j = \mathbb{E} \left[K_h(X-x)(X-x)^j \right]$$, $$j = 0,1,2,$$ and $$\sigma_0^2 = \mu_0 \mu_2 - \mu_1^2$$.

Transformation based approaches
Consider the response variable $$\nu$$ to be probability distributions. With the space of density functions $$\mathcal{F}_f$$ and a Hilbert space of functions $$\mathbb{H}$$, consider continuous and invertible transformations $$\Psi: \mathcal{F}_f \to \mathbb{H}$$. Examples of transformations include log hazard transformation, log quantile density transformation, or centered log-ratio transformation. Linear methods such as functional linear models are applied to the transformed variables. The fitted models are interpreted back in the original density space $$\mathcal{F}$$ using the inverse transformation.

Random object approaches
In Wasserstein regression, both predictors $$\omega$$ and responses $$\nu$$ can be distributional objects. Let $$\omega{\oplus}$$ and $$\nu_{\oplus}$$ be the Wasserstein mean of $$\omega$$ and $$\nu$$, respectively. The Wasserstein regression model is defined as $$\mathbb{E}(\log_{\nu_{\oplus}} \nu | \log_{\omega{\oplus}} \omega) = \Gamma(\log_{\omega{\oplus}} \omega),$$ with a linear regression operator $$ \Gamma g(t) = \langle \beta(\cdot, t),g \rangle_{\omega{\oplus}}, \; t \in D, \; g \in T_{\omega{\oplus}}, \; \beta:D^2 \to \R.$$ Estimation of the regression operator is based on empirical estimators obtained from samples. Also, the Fisher-Rao metric $$d_{FR}$$ can be used in a similar fashion.

Wasserstein F-test
Wasserstein $$F$$-test has been proposed to test for the effects of the predictors in the Fréchet regression framework with the Wasserstein metric. Consider Euclidean predictors $$X \in \R^p$$ and distributional responses $$\nu \in \mathcal{W}_2$$. Denote the Wasserstein mean of $$\nu$$ as $$\mu_\oplus^*$$, and the sample Wasserstein mean as $$\hat{\mu}_\oplus^*$$. Consider the global Wasserstein-Fréchet regression model $$m_\oplus (x)$$ defined in ($$), which is the conditional Wasserstein mean given $$X=x$$. The estimator of $$m_\oplus (x)$$, $$\hat{m}_\oplus (x)$$ is obtained by minimizing the empirical version of the criterion.

Let $$F$$, $$Q$$, $$f$$, $$F_\oplus^*$$, $$Q_\oplus^*$$, $$f_\oplus^*$$, $$F_\oplus(x)$$, $$Q_\oplus(x)$$, and $$f_\oplus(x)$$ denote the cumulative distribution, quantile, and density functions of $$\nu$$, $$\mu_\oplus^*$$, and $$m_\oplus(x)$$, respectively. For a pair $$(X, \nu)$$, define $$T = Q \circ F_\oplus (X)$$ be the optimal transport map from $$m_\oplus(X)$$ to $$\nu$$. Also, define $$S = Q_\oplus (X) \circ F_\oplus^*$$, the optimal transport map from $$\mu_\oplus^*$$ to $$m_\oplus(x)$$. Finally, define the covariance kernel $$K(u, v) = \mathbb{E}[\text{Cov}((T\circ S)(u), (T\circ S)(v) )]$$ and by the Mercer decomposition, $$K(u, v) = \sum_{j=1}^\infty \lambda_j \phi_j(u) \phi_j(v)$$.

If there are no regression effects, the conditional Wasserstein mean would equal the Wasserstein mean. That is, hypotheses for the test of no effects are $$ H_0: m_\oplus (x) \equiv \mu_\oplus^* \quad \text{v.s.} \quad H_1: \text{Not }H_0. $$ To test for these hypotheses, the proposed global Wasserstein $$F$$-statistic and its asymptotic distribution are $$ F_G = \sum_{i=1}^n d_{W_2}^2( \hat{m}_\oplus (x), \hat{\mu}_\oplus^*), \quad F_G|X_1, \cdots, X_n \overset{d}{\longrightarrow} \sum_{j=1}^\infty \lambda_j V_j \; a.s., $$ where $$V_j \overset{iid}{\sim} \chi_p^2$$. An extension to hypothesis testing for partial regression effects, and alternative testing approximations using the Satterthwaite's approximation or a bootstrap approach are proposed.

Tests for the intrinsic mean
The Hilbert sphere $$\mathcal{S}^\infty$$ is defined as $$\mathcal{S}^\infty = \left\{f \in \mathbb{H} : \| f \|_{\mathbb{H}}=1 \right\}$$, where $$\mathbb{H}$$ is a separable infinite-dimensional Hilbert space with inner product $$\langle \cdot, \cdot \rangle_{\mathbb{H}}$$ and norm $$\| \cdot \|_{\mathbb{H}}$$. Consider the space of square root densities $$\mathcal{X} = \left\{ x:D \to \mathbb{R}: x = \sqrt{f}, \int_D f(t)dt = 1 \right\}$$. Then with the Fisher-Rao metric $$d_{FR}$$ on $$f$$, $$\mathcal{X}$$ is the positive orthant of the Hilbert sphere $$\mathcal{S}^\infty$$ with $$\mathbb{H} = L^2(D)$$.

Let a chart $$\tau: U \subset \mathcal{S}^\infty \to \mathbb{G}$$ as a smooth homeomorphism that maps $$U$$ onto an open subset $$\tau(U)$$ of a separable Hilbert space $$\mathbb{G}$$ for coordinates. For example, $$\tau$$ can be the logarithm map.

Consider a random element $$x = \sqrt{f} \in \mathcal{X}$$ equipped with the Fisher-Rao metric, and write its Fréchet mean as $$\mu$$. Let the empirical estimator of $$\mu$$ using $$n$$ samples as $$\hat{\mu}$$. Then central limit theorem for $$\hat{\mu}_\tau = \tau(\hat{\mu})$$ and $$\mu_\tau = \tau(\mu)$$ holds: $$\sqrt{n}(\hat{\mu}_\tau - \mu_\tau ) \overset{L}{\longrightarrow} Z, \; n \to \infty$$, where $$Z$$ is a Gaussian random element in $$\mathbb{G}$$ with mean 0 and covariance operator $$\mathcal{T}$$. Let the eigenvalue-eigenfunction pairs of $$\mathcal{T}$$ and the estimated covariance operator $$\hat{\mathcal{T}}$$ as $$(\lambda_k, \phi_k)_{k=1}^\infty$$ and $$(\hat\lambda_k, \hat\phi_k)_{k=1}^\infty$$, respectively.

Consider one-sample hypothesis testing $$ H_0: \mu = \mu_0 \quad \text{v.s.} \quad H_1: \mu \neq \mu_0, $$ with $$\mu_0 \in \mathcal{S}^\infty$$. Denote $$\| \cdot \|_{\mathbb{G}}$$ and $$\langle \cdot, \cdot \rangle_{\mathbb{G}}$$ as the norm and inner product in $$\mathbb{G}$$. The test statistics and their limiting distributions are $$\begin{align} T_1 &= n \| \tau(\hat{\mu}) - \tau(\mu_0)\|_\mathbb{G}^2 \overset{L}{\longrightarrow} \lambda_k W_k, \\ S_1 &= n \sum_{k=1}^K \frac{\langle \tau(\hat{\mu}) - \tau(\mu_0), \hat{\phi}_k \rangle_\mathbb{G}^2}{\hat{\lambda}_k} \overset{L}{\longrightarrow} \chi_K^2, \end{align}$$ where $$W_k \overset{iid}{\sim} \chi_1^2$$. The actual testing procedure can be done by employing the limiting distributions with Monte Carlo simulations, or bootstrap tests are possible. An extension to the two-sample test and paired test are also proposed.

Distributional time series
Autoregressive (AR) models for distributional time series are constructed by defining stationarity and utilizing the notion of difference between distributions using $$d_{W_2}$$ and $$d_{FR}$$.

In Wasserstein autoregressive model (WAR), consider a stationary density time series $$f_t$$ with Wasserstein mean $$f_\oplus$$. Denote the difference between $$f_t$$ and $$f_\oplus$$ using the logarithm map, $$f_t \ominus f_{\oplus} = \log_{f_\oplus} f_t = T_t - \text{id}$$, where $$T_t = Q_t \circ F_\oplus$$ is the optimal transport from $$f_\oplus$$ to $$f_t$$ in which $$F_t$$ and $$F_{\oplus}$$ are the cdf of $$f_t$$ and $$f_{\oplus}$$. An $$AR(1)$$ model on the tangent space $$T_{f_\oplus}$$ is defined as $$V_t = \beta V_{t-1} + \epsilon_t, \; t \in \mathbb{Z},$$ for $$V_t \in T_{f_\oplus}$$ with the autoregressive parameter $$\beta \in \mathbb{R}$$ and mean zero random i.i.d. innovations $$\epsilon_t$$. Under proper conditions, $$\mu_t = \exp_{f_\oplus}(V_t)$$ with densities $$f_t$$ and $$V_t = \log_{f_\oplus}(\mu_t)$$. Accordingly, $$WAR(1)$$, with a natural extension to order $$p$$, is defined as $$ T_t - \text{id} = \beta (T_{t-1} - \text{id} ) + \epsilon_t. $$

On the other hand, the spherical autoregressive model (SAR) considers the Fisher-Rao metric. Following the settings of, let $$x_t \in \mathcal{X}$$ with Fréchet mean $$\mu_x$$. Let $$\theta = \arccos(\langle x_t, \mu_x \rangle )$$, which is the geodesic distance between $$x_t$$ and $$\mu_x$$. Define a rotation operator $$Q_{x_t, \mu_x}$$ that rotates $$x_t$$ to $$\mu_x$$. The spherical difference between $$x_t$$ and $$\mu_x$$ is represented as $$R_t = x_t \ominus \mu_x = \theta Q_{x_t, \mu_x}$$. Assume that $$R_t$$ is a stationary sequence with the Fréchet mean $$\mu_R$$, then $$SAR(1)$$ is defined as $$ R_t - \mu_R = \beta (R_{t-1} - \mu_R) + \epsilon_t, $$ where $$\mu_R = \mathbb{E}R_t$$ and mean zero random i.i.d innovations $$\epsilon_t$$. An alternative model, the differenced based spherical autoregressive (DSAR) model is defined with $$R_t = x_{t+1} \ominus x_t$$, with natural extensions to order $$p$$. A similar extension to the Wasserstein space was introduced.