Skip to content

Latest commit

 

History

History
122 lines (76 loc) · 2.82 KB

F.rst

File metadata and controls

122 lines (76 loc) · 2.82 KB

F-Distribution

Table of contents


The density function of the F distribution:

f(x; d_1, d_2) = \frac{1}{\mathcal{B} \left( \frac{d_1}{2}, \frac{d_2}{2} \right)} \left( \frac{d_1}{d_2} \right)^{\frac{d_1}{2}} x^{d_1/2 - 1} \left(1 + \frac{d_1}{d_2} x \right)^{- \frac{d_1+d_2}{2}} \times \mathbf{1} [x \geq 0]

where \mathcal{B}(a,b) denotes the Beta function.

Methods for scalar input, as well as for list input, are listed below.

.. autofunction:: pystats.df(x: float, df1: float = 1.0, df2: float = 1.0, log: bool = False) -> float
   :noindex:

.. autofunction:: pystats.df(x: List[float], df1: float = 1.0, df2: float = 1.0, log: bool = False) -> List[float]
   :noindex:


The cumulative distribution function (CDF) of the F distribution:

F(x; d_1, d_2) = \int_0^x f(z; d_1, d_2) dz = I_{\frac{d_1 x}{d_2 + d_1 x}} (d_1 / 2, d_2 / 2)

where I_x (a,b) denotes the regularized incomplete Beta function.

Methods for scalar input, as well as for list input, are listed below.

.. autofunction:: pystats.pf(p: float, df1: float = 1.0, df2: float = 1.0, log: bool = False) -> float
   :noindex:

.. autofunction:: pystats.pf(p: List[float], df1: float = 1.0, df2: float = 1.0, log: bool = False) -> List[float]
   :noindex:


The quantile function of the F distribution:

q(p; a,b) = \inf \left\{ x : p \leq I_{\frac{d_1 x}{d_2 + d_1 x}} (d_1 / 2, d_2 / 2) \right\}

Methods for scalar input, as well as for list input, are listed below.

.. autofunction:: pystats.qf(q: float, df1: float = 1.0, df2: float = 1.0) -> float
   :noindex:

.. autofunction:: pystats.qf(q: List[float], df1: float = 1.0, df2: float = 1.0) -> List[float]
   :noindex:


Random sampling for the Beta distribution is achieved by simulating two independent \chi^2-distributed random variables, X \sim \chi^2(d_1), Y \sim \chi^2(d_2), then returning:

Z = \frac{d_1}{d_2} \frac{X}{Y}
.. autofunction:: pystats.rf(df1: float = 1.0, df2: float = 1.0) -> float
   :noindex:

.. autofunction:: pystats.rf(n: int, df1: float = 1.0, df2: float = 1.0) -> List[float]
   :noindex: