class_docstr: Class for the manifold of beta distributions.
  
  This is Beta = :math:`R_+^* \times R_+^*`, the upper-right
  quadrant of the Euclidean plane.
  
  Attributes
  ----------
  dim : int
      Dimension of the manifold of beta distributions, equal to 2.
  embedding_space : Manifold
      Embedding manifold.
class_docstr_tok: ["Class","for","the","manifold","of","beta","distributions",".","This","is","Beta","=",":","math",":","`","R_+^","*","\\times","R_+^","*","`",",","the","upper-right","quadrant","of","the","Euclidean","plane",".","Attributes","--","--","--","--","--","dim",":","int","Dimension","of","the","manifold","of","beta","distributions",",","equal","to","2.","embedding_space",":","Manifold","Embedding","manifold","."]
docstr: Estimate parameters from samples.
  
  This a wrapper around scipy's maximum likelihood estimator to
  estimate the parameters of a beta distribution from samples.
  
  Parameters
  ----------
  data : array-like, shape=[..., n_samples]
      Data to estimate parameters from. Arrays of
      different length may be passed.
  loc : float
      Location parameter of the distribution to estimate parameters
      from. It is kept fixed during optimization.
      Optional, default: 0.
  scale : float
      Scale parameter of the distribution to estimate parameters
      from. It is kept fixed during optimization.
      Optional, default: 1.
  
  Returns
  -------
  parameter : array-like, shape=[..., 2]
      Estimate of parameter obtained by maximum likelihood.
docstr_tok: ["Estimate","parameters","from","samples",".","This","a","wrapper","around","scipy","'s","maximum","likelihood","estimator","to","estimate","the","parameters","of","a","beta","distribution","from","samples",".","Parameters","--","--","--","--","--","data",":","array-like",",","shape=","[","...",",","n_samples","]","Data","to","estimate","parameters","from",".","Arrays","of","different","length","may","be","passed",".","loc",":","float","Location","parameter","of","the","distribution","to","estimate","parameters","from",".","It","is","kept","fixed","during","optimization",".","Optional",",","default",":","0.","scale",":","float","Scale","parameter","of","the","distribution","to","estimate","parameters","from",".","It","is","kept","fixed","during","optimization",".","Optional",",","default",":","1",".","Returns","--","--","--","-","parameter",":","array-like",",","shape=","[","...",",","2","]","Estimate","of","parameter","obtained","by","maximum","likelihood","."]
code: def maximum_likelihood_fit(data, loc=0, scale=1, epsilon=1e-6):
      """Estimate parameters from samples.
  
      This a wrapper around scipy's maximum likelihood estimator to
      estimate the parameters of a beta distribution from samples.
  
      Parameters
      ----------
      data : array-like, shape=[..., n_samples]
          Data to estimate parameters from. Arrays of
          different length may be passed.
      loc : float
          Location parameter of the distribution to estimate parameters
          from. It is kept fixed during optimization.
          Optional, default: 0.
      scale : float
          Scale parameter of the distribution to estimate parameters
          from. It is kept fixed during optimization.
          Optional, default: 1.
  
      Returns
      -------
      parameter : array-like, shape=[..., 2]
          Estimate of parameter obtained by maximum likelihood.
      """
      data = gs.where(data == 1.0, 1.0 - epsilon, data)
      data = gs.where(data == 0.0, epsilon, data)
      data = gs.to_ndarray(data, to_ndim=2)
      parameters = []
      for sample in data:
          param_a, param_b, _, _ = beta.fit(
              sample, floc=loc, fscale=scale
          )
          parameters.append(gs.array([param_a, param_b]))
      return parameters[0] if len(data) == 1 else gs.stack(parameters)
  
file_path: geomstats/geomstats/information_geometry/beta.py
imports: from scipy.stats import beta
  import geomstats.backend
  from geomstats.information_geometry.base import ScipyUnivariateRandomVariable
  from geomstats.information_geometry.dirichlet import DirichletDistributions, DirichletMetric
label_desc: Use image node_id 5 for calling the BetaDistributions obj's underlying member method code with example usage: obj.maximum_likelihood_fit(data, loc, scale, epsilon) and returns: unknown