F Distribution¤
stamox.distribution.pF(q: Union[Float, ArrayLike], dfn: Union[Float, ArrayLike], dfd: Union[Float, ArrayLike], lower_tail: bool = True, log_prob: bool = False, dtype = <class 'jax.numpy.float64'>) -> ArrayLike
¤
Calculates the cumulative distribution function of the F-distribution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
q |
Union[Float, ArrayLike] |
The value at which to evaluate the cdf. |
required |
dfn |
Union[Float, ArrayLike] |
The numerator degrees of freedom. |
required |
dfd |
Union[Float, ArrayLike] |
The denominator degrees of freedom. |
required |
lower_tail |
bool |
If True (default), the lower tail probability is returned. |
True |
log_prob |
bool |
If True, the logarithm of the probability is returned. |
False |
dtype |
jnp.dtype |
The dtype of the output (default is jnp.float_). |
<class 'jax.numpy.float64'> |
Returns:
Type | Description |
---|---|
ArrayLike |
The cumulative distribution function evaluated at |
Examples:
>>> pF(1.0, 1.0, 1.0)
Array(0.5000001, dtype=float32, weak_type=True)
stamox.distribution.qF(p: Union[Float, ArrayLike], dfn: Union[Float, ArrayLike], dfd: Union[Float, ArrayLike], lower_tail: bool = True, log_prob: bool = False, dtype = <class 'jax.numpy.float64'>) -> ArrayLike
¤
Calculates the quantile function of a given distribution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
p |
Union[Float, ArrayLike] |
The quantile to calculate. |
required |
dfn |
Union[Float, ArrayLike] |
The degrees of freedom for the numerator. |
required |
dfd |
Union[Float, ArrayLike] |
The degrees of freedom for the denominator. |
required |
lower_tail |
bool |
Whether to calculate the lower tail or not. Defaults to True. |
True |
log_prob |
bool |
Whether to calculate the log probability or not. Defaults to False. |
False |
dtype |
jnp.dtype |
The dtype of the output. Defaults to jnp.float_. |
<class 'jax.numpy.float64'> |
Returns:
Type | Description |
---|---|
ArrayLike |
The calculated quantile. |
Examples:
>>> qF(0.5, 1.0, 1.0)
Array([0.99999714], dtype=float32)
stamox.distribution.dF(x: Union[Float, ArrayLike], dfn: Union[Float, ArrayLike], dfd: Union[Float, ArrayLike], lower_tail: bool = True, log_prob: bool = False, dtype = <class 'jax.numpy.float64'>) -> ArrayLike
¤
Calculates the gradient of the cumulative distribution function for a given x, dfn and dfd.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
Union[Float, ArrayLike] |
The value at which to calculate the gradient of the cumulative distribution function. |
required |
dfn |
Union[Float, ArrayLike] |
The numerator degrees of freedom. |
required |
dfd |
Union[Float, ArrayLike] |
The denominator degrees of freedom. |
required |
lower_tail |
bool |
Whether to calculate the lower tail of the cumulative distribution function. Defaults to True. |
True |
log_prob |
bool |
Whether to return the log probability. Defaults to False. |
False |
dtype |
jnp.dtype |
The dtype of the output. Defaults to jnp.float_. |
<class 'jax.numpy.float64'> |
Returns:
Type | Description |
---|---|
ArrayLike |
The gradient of the cumulative distribution function. |
Examples:
>>> dF(1.0, 1.0, 1.0)
Array(0.1591549, dtype=float32, weak_type=True)
stamox.distribution.rF(key: Union[jax.Array, jax._src.prng.PRNGKeyArray], sample_shape: Optional[Sequence[int]] = None, dfn: Union[Float, ArrayLike] = None, dfd: Union[Float, ArrayLike] = None, lower_tail: bool = True, log_prob: bool = False, dtype = <class 'jax.numpy.float64'>)
¤
Generate random variates from F-distribution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
KeyArray |
Random key used for PRNG. |
required |
sample_shape |
Optional[Shape] |
Shape of the samples to be drawn. Defaults to None. |
None |
dfn |
Union[Float, ArrayLike] |
Degrees of freedom in numerator. |
None |
dfd |
Union[Float, ArrayLike] |
Degrees of freedom in denominator. |
None |
lower_tail |
bool |
Whether to calculate the lower tail probability. Defaults to True. |
True |
log_prob |
bool |
Whether to return the log probability. Defaults to False. |
False |
dtype |
jnp.dtype |
The dtype of the output. Defaults to float32. |
<class 'jax.numpy.float64'> |
Returns:
Type | Description |
---|---|
ArrayLike |
Random variates from F-distribution. |
Examples:
>>> rF(jax.random.PRNGKey(0), dfn=1.0, dfd=1.0)
Array(40.787617, dtype=float32)