F-Distribution¶
Table of contents
Density Function¶
The density function of the F distribution:
where \(\mathcal{B}(a,b)\) denotes the Beta function.
Methods for scalar input, as well as for list input, are listed below.
Scalar Input¶
- pystats.df(x: float, df1: float = 1.0, df2: float = 1.0, log: bool = False) float
Density function of the F-distribution distribution.
Example
>>> pystats.df(1.5, 10.0, 12.0) 0.3426270538333347
- Parameters
x (float) – A real-valued input.
df1 (float) – A degrees of freedom parameter, a real-valued input.
df2 (float) – A degrees of freedom parameter, a real-valued input.
log (bool) – Return the log-density or the true form.
- Returns
The density function evaluated at x.
List Input¶
- pystats.df(x: List[float], df1: float = 1.0, df2: float = 1.0, log: bool = False) List[float]
Density function of the F-distribution distribution.
Example
>>> pystats.df([0.3, 0.5, 0.9], 10.0, 12.0) [0.3523215359999982, 0.6861197229627093, 0.7047187344898975]
- Parameters
x (List[float]) – A standard list input.
df1 (float) – A degrees of freedom parameter, a real-valued input.
df2 (float) – A degrees of freedom parameter, a real-valued input.
log (bool) – Return the log-density or the true form.
- Returns
A list of density values corresponding to the elements of x.
Cumulative Distribution Function¶
The cumulative distribution function (CDF) of the F distribution:
where \(I_x (a,b)\) denotes the regularized incomplete Beta function.
Methods for scalar input, as well as for list input, are listed below.
Scalar Input¶
- pystats.pf(p: float, df1: float = 1.0, df2: float = 1.0, log: bool = False) float
Distribution function of the F-distribution distribution.
Example
>>> pystats.pf(1.5, 10.0, 12.0) 0.7501297253279772
- Parameters
p (float) – A real-valued input.
df1 (float) – A degrees of freedom parameter, a real-valued input.
df2 (float) – A degrees of freedom parameter, a real-valued input.
log (bool) – Return the log-density or the true form.
- Returns
The cumulative distribution function evaluated at p.
List Input¶
- pystats.pf(p: List[float], df1: float = 1.0, df2: float = 1.0, log: bool = False) List[float]
Distribution function of the F-distribution distribution.
Example
>>> pystats.pf([0.3, 0.5, 0.9], 10.0, 12.0) [0.03279349759999985, 0.14036282082102308, 0.43990811032084115]
- Parameters
p (List[float]) – A standard list input.
df1 (float) – A degrees of freedom parameter, a real-valued input.
df2 (float) – A degrees of freedom parameter, a real-valued input.
log (bool) – Return the log-density or the true form.
- Returns
A list of CDF values corresponding to the elements of p.
Quantile Function¶
The quantile function of the F distribution:
Methods for scalar input, as well as for list input, are listed below.
Scalar Input¶
- pystats.qf(q: float, df1: float = 1.0, df2: float = 1.0) float
Quantile function of the F-distribution distribution.
Example
>>> pystats.qf(0.5, 10.0, 12.0) 0.9885595669294069
- Parameters
q (float) – A real-valued input.
df1 (float) – A degrees of freedom parameter, a real-valued input.
df2 (float) – A degrees of freedom parameter, a real-valued input.
- Returns
The quantile function evaluated at q.
List Input¶
- pystats.qf(q: List[float], df1: float = 1.0, df2: float = 1.0) List[float]
Quantile function of the F-distribution distribution.
Example
>>> pystats.qf([0.3, 0.5, 0.9], 10.0, 12.0) [0.7125992144145168, 0.9885595669294069, 2.1877640788750874]
- Parameters
q (List[float]) – A standard list input.
df1 (float) – A degrees of freedom parameter, a real-valued input.
df2 (float) – A degrees of freedom parameter, a real-valued input.
- Returns
A list of quantiles values corresponding to the elements of q.
Random Sampling¶
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:
Scalar Output¶
- pystats.rf(df1: float = 1.0, df2: float = 1.0) float
Random sampling function for the F-distribution distribution.
Example
>>> pystats.rf(10.0, 12.0) 2.646874442851056
- Parameters
df1 (float) – A degrees of freedom parameter, a real-valued input.
df2 (float) – A degrees of freedom parameter, a real-valued input.
- Returns
A pseudo-random draw from the F-distribution distribution.
List Output¶
- pystats.rf(n: int, df1: float = 1.0, df2: float = 1.0) List[float]
Random sampling function for the F-distribution distribution.
Example
>>> pystats.rf(3, 10.0, 12.0) [0.4932413364221738, 0.2827026830899671, 2.750316525821291]
- Parameters
n (int) – The number of output values.
df1 (float) – A degrees of freedom parameter, a real-valued input.
df2 (float) – A degrees of freedom parameter, a real-valued input.
- Returns
A list of pseudo-random draws from the F-distribution distribution.