class_docstr: Class for the Fisher information metric on Dirichlet distributions.
class_docstr_tok: ["Class","for","the","Fisher","information","metric","on","Dirichlet","distributions","."]
docstr: Compute the Christoffel symbols.
  
  Compute the Christoffel symbols of the Fisher information metric.
  
  References
  ----------
  .. [LPP2021] A. Le Brigant, S. C. Preston, S. Puechmorel. Fisher-Rao
      geometry of Dirichlet Distributions. Differential Geometry
      and its Applications, 74, 101702, 2021.
  
  Parameters
  ----------
  base_point : array-like, shape=[..., dim]
      Base point.
  
  Returns
  -------
  christoffels : array-like, shape=[..., dim, dim, dim]
      Christoffel symbols, with the contravariant index on
      the first dimension.
      :math:`christoffels[..., i, j, k] = Gamma^i_{jk}`
docstr_tok: ["Compute","the","Christoffel","symbols",".","Compute","the","Christoffel","symbols","of","the","Fisher","information","metric",".","References","--","--","--","--","--","..","[","LPP2021","]","A",".","Le","Brigant",",","S.","C.","Preston",",","S.","Puechmorel",".","Fisher-Rao","geometry","of","Dirichlet","Distributions",".","Differential","Geometry","and","its","Applications",",","74",",","101702",",","2021",".","Parameters","--","--","--","--","--","base_point",":","array-like",",","shape=","[","...",",","dim","]","Base","point",".","Returns","--","--","--","-","christoffels",":","array-like",",","shape=","[","...",",","dim",",","dim",",","dim","]","Christoffel","symbols",",","with","the","contravariant","index","on","the","first","dimension",".",":","math",":","`","christoffels","[","...",",","i",",","j",",","k","]","=","Gamma^i_","{","jk","}","`"]
code: def christoffels(self, base_point):
      """Compute the Christoffel symbols.
  
      Compute the Christoffel symbols of the Fisher information metric.
  
      References
      ----------
      .. [LPP2021] A. Le Brigant, S. C. Preston, S. Puechmorel. Fisher-Rao
          geometry of Dirichlet Distributions. Differential Geometry
          and its Applications, 74, 101702, 2021.
  
      Parameters
      ----------
      base_point : array-like, shape=[..., dim]
          Base point.
  
      Returns
      -------
      christoffels : array-like, shape=[..., dim, dim, dim]
          Christoffel symbols, with the contravariant index on
          the first dimension.
          :math:`christoffels[..., i, j, k] = Gamma^i_{jk}`
      """
      base_point = gs.to_ndarray(base_point, to_ndim=2)
      n_points = base_point.shape[0]
  
      def coefficients(ind_k):
          """Christoffel symbols for contravariant index ind_k."""
          param_k = base_point[..., ind_k]
          param_sum = gs.sum(base_point, -1)
          c1 = (
              1
              / gs.polygamma(1, param_k)
              / (
                  1 / gs.polygamma(1, param_sum)
                  - gs.sum(1 / gs.polygamma(1, base_point), -1)
              )
          )
          c2 = (
              -c1
              * gs.polygamma(2, param_sum)
              / gs.polygamma(1, param_sum)
          )
  
          mat_ones = gs.ones(
              (n_points, self._space.dim, self._space.dim)
          )
          mat_diag = from_vector_to_diagonal_matrix(
              -gs.polygamma(2, base_point) / gs.polygamma(1, base_point)
          )
          arrays = [
              gs.zeros((1, ind_k)),
              gs.ones((1, 1)),
              gs.zeros((1, self._space.dim - ind_k - 1)),
          ]
          vec_k = gs.tile(gs.hstack(arrays), (n_points, 1))
          val_k = gs.polygamma(2, param_k) / gs.polygamma(1, param_k)
          vec_k = gs.einsum("i,ij->ij", val_k, vec_k)
          mat_k = from_vector_to_diagonal_matrix(vec_k)
  
          mat = (
              gs.einsum("i,ijk->ijk", c2, mat_ones)
              - gs.einsum("i,ijk->ijk", c1, mat_diag)
              + mat_k
          )
  
          return 1 / 2 * mat
  
      christoffels = []
      for ind_k in range(self._space.dim):
          christoffels.append(coefficients(ind_k))
      christoffels = gs.stack(christoffels, 1)
  
      return gs.squeeze(christoffels)
  
imports: import math
  import numpy
  from scipy.optimize import minimize
  from scipy.stats import dirichlet
  import geomstats.backend
  from geomstats.algebra_utils import from_vector_to_diagonal_matrix
  from geomstats.geometry.base import VectorSpaceOpenSet
  from geomstats.geometry.euclidean import Euclidean
  from geomstats.geometry.riemannian_metric import RiemannianMetric
  from geomstats.information_geometry.base import InformationManifoldMixin, ScipyMultivariateRandomVariable
  from geomstats.numerics.bvp import ScipySolveBVP
  from geomstats.numerics.geodesic import ExpODESolver, LogODESolver
  from geomstats.numerics.ivp import ScipySolveIVP
  from geomstats.vectorization import repeat_out
label_desc: Use image node_id 3 for calling the DirichletMetric obj's underlying member method code with example usage: obj.christoffels(base_point) and returns: gs, unknown