code: def main():
      """Visualise the uncertainty of the empirical Fréchet mean on the sphere.
  
      The variance of the Fréchet mean FM_n of a sample of n IID random variables
      of variance Var is decreasing more slowly in a sphere than in a Euclidean
      space. This example computes the  modulation factor
           alpha = Var( FM_n) / ( n * Var)
      for isotropic distributions on hyper-spheres of radius 0 < theta < Pi in
      the sphere S_dim (called here a bubble).
      """
      n_expectation = 10
  
      logging.info(
          "Var of empirical mean for 1 sample, theta=0.1 in S2 (%f, %e)",
          *empirical_frechet_var_bubble(
              1, 0.1, 2, n_expectation=n_expectation
          ),
      )
      logging.info(
          "Var of empirical mean for 1 sample, theta=0.1 in S3 (%f, %e)",
          *empirical_frechet_var_bubble(
              1, 0.1, 3, n_expectation=n_expectation
          ),
      )
  
      logging.info(
          "Modulation factor for 1 sample theta=0.1 in S2 "
          "(should be close to 1): (%f, %e)",
          *modulation_factor(1, 0.1, 2, n_expectation=n_expectation),
      )
  
      logging.info(
          "Modulation factor for 500 sample theta close to Pi/2 in S5 "
          "(should be around 25): (%f, %e)",
          *modulation_factor(
              500, gs.pi / 2 - 0.001, 5, n_expectation=n_expectation
          ),
      )
  
      plot_modulation_factor(2, 2, n_expectation=n_expectation)
      plt.show()
  
file_path: geomstats/examples/empirical_frechet_mean_uncertainty_sn.py
imports: import logging
  import matplotlib.pyplot
  import geomstats.backend
  from geomstats.geometry.hypersphere import Hypersphere
  from geomstats.learning.frechet_mean import FrechetMean
label_desc: Use image node_id 5 for calling a global function with example usage: main() without return types