{ } Raw JSON

bundles / scipy 1.17.1 / scipy / stats / _binomtest / _binary_search_for_binom_tst

function

scipy.stats._binomtest:_binary_search_for_binom_tst

source: /scipy/stats/_binomtest.py :338

Signature

def   _binary_search_for_binom_tst ( a d lo hi )

Summary

Conducts an implicit binary search on a function specified by a.

Extended Summary

Meant to be used on the binomial PMF for the case of two-sided tests to obtain the value on the other side of the mode where the tail probability should be computed. The values on either side of the mode are always in order, meaning binary search is applicable.

Parameters

a : callable

The function over which to perform binary search. Its values for inputs lo and hi should be in ascending order.

d : float

The value to search.

lo : int

The lower end of range to search.

hi : int

The higher end of the range to search.

Returns

: int

The index, i between lo and hi such that a(i)<=d<a(i+1)

Aliases

  • scipy.stats._binomtest._binary_search_for_binom_tst