Package Bio :: Package codonalign :: Module chisq
[hide private]
[frames] | no frames]

Module chisq

source code

Python implementation of chisqprob, to avoid SciPy dependency.

Adapted from SciPy: scipy/special/cephes/{chdtr,igam}.

Functions [hide private]
 
chisqprob(x, df)
Probability value (1-tail) for the Chi^2 probability distribution.
source code
 
_igamc(a, x)
Complemented incomplete Gamma integral.
source code
 
_igam(a, x)
Left tail of incomplete Gamma function.
source code
Variables [hide private]
  MACHEP = 1e-07
  BIG = 4.50359962737e+15
  BIGINV = 2.22044604925e-16
  __package__ = 'Bio.codonalign'
Function Details [hide private]

chisqprob(x, df)

source code 

Probability value (1-tail) for the Chi^2 probability distribution.

Broadcasting rules apply.

Parameters

x : array_like or float > 0

df : array_like or float, probably int >= 1

Returns

chisqprob : ndarray
The area from chisq to infinity under the Chi^2 probability distribution with degrees of freedom df.

_igamc(a, x)

source code 

Complemented incomplete Gamma integral.

Parameters

a: float x: float

Returns

float

Notes

The function is defined by:

igamc(a,x)   =   1 - igam(a,x)

                        inf.
                           -
                  1       | |  -t  a-1
            =   -----     |   e   t   dt.
                 -      | |
                | (a)    -
                            x

In this implementation both arguments must be positive. The integral is evaluated by either a power series or continued fraction expansion, depending on the relative values of a and x.

_igam(a, x)

source code 

Left tail of incomplete Gamma function.

Computes this formula:

        inf.      k
 a  -x   -       x
x  e     >   ----------
         -     -
       k=0   | (a+k+1)