Skip to content

Design: multivariate functional depth for tf_mv (and the median chimera it fixes) #273

@fabian-s

Description

@fabian-s

Follow-up to #255. tf_depth(fm) for tf_mv is not a trivial lift from the univariate case, and the answer ripples to median.tf_mv, tf_order, xtfrm.tf_mv, and any verb that uses depth-based ranking.

The problem

Currently tf_depth.tf_mv inherits the univariate method, which dies on a 3-D array. median.tf_mv (component-wise depth median) returns a chimeric trajectory: each component's median is selected independently, so the "median" is a vector-valued function nobody observed. No multivariate depth notion endorses that.

Candidate definitions

There's an established literature on multivariate functional depth. Worth picking from explicitly:

  1. Pointwise multivariate halfspace then integrate. For each t, compute the Tukey halfspace depth of the vector f(t) ∈ R^d w.r.t. the empirical distribution of {f_i(t)}_{i=1..n}. Integrate over t. Generalizes MHI (which uses pointwise univariate halfspace).
  2. Multivariate band depth. Lopez-Pintado & Romo (2009) and follow-ups extend band depth to multivariate functional data via per-component or joint bands.
  3. Random projection depth. Project to random directions in R^d, compute univariate functional depth on the projections, average. Cuevas et al.
  4. Spatial / L2-depth. 1 - ||f - mean(f)|| / sup||f - mean(f)|| or similar.

Each has different invariance properties (affine equivariance, monotonicity), different computational cost, and different existing R-package availability (e.g. MFPCA, roahd).

Recommendation

Pick one as the default (pointwise multivariate halfspace + integrate is the most principled extension of the existing univariate MHI), and expose method = for the others as future work. Tests should pin: depth values lie in [0, 1], the multivariate median (a tf_mv with one curve = f[which.max(depth)]) is an observed curve (joint selection across components — fixes the chimera bug), and depth reduces to the univariate value when d = 1.

Affected verbs (once tf_depth.tf_mv is implemented)

  • median.tf_mv — joint depth median (no more chimera)
  • tf_order.tf_mv, rank.tf_mv, xtfrm.tf_mv
  • summary.tf_mv if it reports a depth-median

Filed as follow-up to #255 (tf_mv inheritance contract) and the June-2026 ground-up review.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions