class_docstr: Lower bound of ratio of binomial proportions.
  
  This class implements several methods to compute a statistical lower bound of
  the ratio of binomial proportions, e.g. tpr / fpr.
  Most of the methods are based on https://doi.org/10.1111/2041-210X.12304 and
  their code at https://CRAN.R-project.org/package=asbio.
  Clopper pearson is based on https://arxiv.org/pdf/2006.07709.pdf.
  
  Examples:
    >>> tp, fp = np.array([100, 90]), np.array([10, 5])
    >>> pos_size, neg_size = 110, 80
    >>> rb = elb.RatioBound(tp, fp, pos_size, neg_size, 0.05)
    >>> rb.compute_bound(BoundMethod.BAILEY)
    array([4.61953896, 6.87647915])
    >>> rb.compute_bounds([BoundMethod.BAILEY, BoundMethod.KATZ_LOG])
    {<BoundMethod.BAILEY: 'bailey'>: array([4.61953896, 6.87647915]),
     <BoundMethod.KATZ_LOG: 'katz-log'>: array([4.45958661, 6.39712581])}
  
  Attributes:
    available_methods: a dictionary mapping BoundMethod to the function.
class_docstr_tok: ["Lower","bound","of","ratio","of","binomial","proportions",".","This","class","implements","several","methods","to","compute","a","statistical","lower","bound","of","the","ratio","of","binomial","proportions",",","e.g",".","tpr","\/","fpr",".","Most","of","the","methods","are","based","on","https",":","\/\/doi.org\/10.1111\/2041-210X.12304","and","their","code","at","https",":","\/\/CRAN.R-project.org\/package=asbio",".","Clopper","pearson","is","based","on","https",":","\/\/arxiv.org\/pdf\/2006.07709.pdf",".","Examples",":",">",">",">","tp",",","fp","=","np.array","(","[","100",",","90","]",")",",","np.array","(","[","10",",","5","]",")",">",">",">","pos_size",",","neg_size","=","110",",","80",">",">",">","rb","=","elb.RatioBound","(","tp",",","fp",",","pos_size",",","neg_size",",","0.05",")",">",">",">","rb.compute_bound","(","BoundMethod.BAILEY",")","array","(","[","4.61953896",",","6.87647915","]",")",">",">",">","rb.compute_bounds","(","[","BoundMethod.BAILEY",",","BoundMethod.KATZ_LOG","]",")","{","<","BoundMethod.BAILEY",":","'bailey","'",">",":","array","(","[","4.61953896",",","6.87647915","]",")",",","<","BoundMethod.KATZ_LOG",":","'katz-log","'",">",":","array","(","[","4.45958661",",","6.39712581","]",")","}","Attributes",":","available_methods",":","a","dictionary","mapping","BoundMethod","to","the","function","."]
docstr: Computes ratio bound using a specified method.
  
  Args:
    method: the method to use for ratio bound.
  
  Returns:
    An array of bounds or a scalar if the input tp is scalar.
docstr_tok: ["Computes","ratio","bound","using","a","specified","method",".","Args",":","method",":","the","method","to","use","for","ratio","bound",".","Returns",":","An","array","of","bounds","or","a","scalar","if","the","input","tp","is","scalar","."]
code: def compute_bound(
      self, method: BoundMethod
  ) -> Union[float, npt.NDArray[float]]:
      """Computes ratio bound using a specified method.
  
      Args:
        method: the method to use for ratio bound.
  
      Returns:
        An array of bounds or a scalar if the input tp is scalar.
      """
      if method not in self.available_methods:
          raise ValueError(f"Method {method} not recognized.")
      bound = self.available_methods[method]()
      if self._is_scalar:
          bound = bound[0]  # Take the element if of size 1
      return bound
  
imports: import enum
  import numbers
  from typing import Dict, Iterable, Optional, Sequence, Union
  import immutabledict
  import numpy
  import numpy.typing
  import scipy.integrate
  import scipy.optimize
  import scipy.stats
  import sklearn.metrics
  from statsmodels.stats import proportion
label_desc: Use image node_id 3 for calling the RatioBound obj's underlying member method code with example usage: obj.compute_bound(method) and returns: bound