trim_mean#

skfda.exploratory.stats.trim_mean(X, proportiontocut, *, depth_method=None)[source]#

Compute the trimmed means based on a depth measure.

The trimmed means consists in computing the mean function without a percentage of least deep curves. That is, we first remove the least deep curves and then we compute the mean as usual.

Note that in scipy the leftmost and rightmost proportiontocut data are removed. In this case, as we order the data by the depth, we only remove those that have the least depth values.

Parameters:
  • X (F) – Object containing different samples of a functional variable.

  • proportiontocut (float) – Indicates the percentage of functions to remove. It is not easy to determine as it varies from dataset to dataset.

  • depth_method (Depth[F] | None) – Method used to order the data. Defaults to modified band depth.

Returns:

Object containing the computed trimmed mean.

Return type:

FDataGrid