fisher_rao_karcher_mean#
- skfda.exploratory.stats.fisher_rao_karcher_mean(fdatagrid, *, penalty=0, center=True, max_iter=20, tol=0.001, initial=None, grid_dim=7, **kwargs)[source]#
Compute the Karcher mean under the elastic metric.
Calculates the Karcher mean of a set of functional samples in the amplitude space \(\mathcal{A}=\mathcal{F}/\Gamma\).
Let \(q_i\) the corresponding SRSF of the observation \(f_i\). The space \(\mathcal{A}\) is defined using the equivalence classes \([q_i]=\{ q_i \circ \gamma \| \gamma \in \Gamma \}\), where \(\Gamma\) denotes the space of warping functions. The karcher mean in this space is defined as
\[[\mu_q] = argmin_{[q] \in \mathcal{A}} \sum_{i=1}^n d_{\lambda}^2([q],[q_i])\]Once \([\mu_q]\) is obtained it is selected the element of the equivalence class which makes the mean of the warpings employed be the identity.
- Parameters:
fdatagrid (FDataGrid) – Set of functions to compute the mean.
penalty (float) – Penalisation term. Defaults to 0.
center (bool) – If
True
it is computed the mean of the warpings and used to select a central mean. DefaultsTrue
.max_iter (int) – Maximum number of iterations. Defaults to 20.
tol (float) – Convergence criterion, the algorithm will stop if \(|mu_{(\nu)} - mu_{(\nu - 1)}|_2 / | mu_{(\nu-1)} |_2 < tol\).
initial (float | None) – Value of the mean at the starting point. By default takes the average of the initial points of the samples.
grid_dim (int) – Dimension of the grid used in the alignment algorithm. Defaults 7.
kwargs (Any) – Named options to be pased to
_fisher_rao_warping_mean()
.
- Returns:
FDatagrid with the mean of the functions.
- Raises:
ValueError – If the object is multidimensional or the shape of the srsf do not match with the fdatagrid.
- Return type:
References