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:
- 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).
- Multivariate band depth. Lopez-Pintado & Romo (2009) and follow-ups extend band depth to multivariate functional data via per-component or joint bands.
- Random projection depth. Project to random directions in
R^d, compute univariate functional depth on the projections, average. Cuevas et al.
- 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.
Follow-up to #255.
tf_depth(fm)fortf_mvis not a trivial lift from the univariate case, and the answer ripples tomedian.tf_mv,tf_order,xtfrm.tf_mv, and any verb that uses depth-based ranking.The problem
Currently
tf_depth.tf_mvinherits 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:
t, compute the Tukey halfspace depth of the vectorf(t) ∈ R^dw.r.t. the empirical distribution of{f_i(t)}_{i=1..n}. Integrate overt. Generalizes MHI (which uses pointwise univariate halfspace).R^d, compute univariate functional depth on the projections, average. Cuevas et al.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 whend = 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_mvsummary.tf_mvif it reports a depth-medianFiled as follow-up to #255 (
tf_mvinheritance contract) and the June-2026 ground-up review.