This function computes the Frechet mean of a sample using an iterative algorithm with optional parallel processing.
compute_frechet_mean(
sample,
tol = 0.05,
max_iter = 20,
lr = 0.2,
batch_size = 32,
progress = FALSE
)The computed Frechet mean as a dppMatrix object.
An object of class CSample containing the sample data.
A numeric value specifying the tolerance for convergence. Default is 0.05.
An integer specifying the maximum number of iterations. Default is 20.
A numeric value specifying the learning rate. Default is 0.2.
Integer. The number of samples to process in each batch during computation. Default is 32.
Logical indicating whether to show progress during computation (default: FALSE). Requires progressr package.
The function iteratively updates the reference point of the sample until the change in the reference point is less than the specified tolerance or the maximum number of iterations is reached. If the tangent images are not already computed, they will be computed before starting the iterations.
When parallel processing is enabled (via set_parallel_plan()), the relocate() function will use parallel
processing for relocating tangent images in each iteration, which can significantly speed up computation
for large samples.