Fisher: Fisher Distribution

View source: R/02_Fisher.R

FisherR Documentation

Fisher Distribution

Description

The Fisher (F) distribution is an absolute continuous probability distribution that arises frequently in the analysis of variance (ANOVA) and in hypothesis testing. It is defined by two degrees of freedom parameters d_1 > 0 and d_2 > 0.

Usage

Fisher(df1 = 1, df2 = 1)

## S4 method for signature 'Fisher,numeric'
d(distr, x, log = FALSE)

## S4 method for signature 'Fisher,numeric'
p(distr, q, lower.tail = TRUE, log.p = FALSE)

## S4 method for signature 'Fisher,numeric'
qn(distr, p, lower.tail = TRUE, log.p = FALSE)

## S4 method for signature 'Fisher,numeric'
r(distr, n)

## S4 method for signature 'Fisher'
mean(x)

## S4 method for signature 'Fisher'
median(x)

## S4 method for signature 'Fisher'
mode(x)

## S4 method for signature 'Fisher'
var(x)

## S4 method for signature 'Fisher'
sd(x)

## S4 method for signature 'Fisher'
skew(x)

## S4 method for signature 'Fisher'
kurt(x)

## S4 method for signature 'Fisher'
entro(x)

llf(x, df1, df2)

## S4 method for signature 'Fisher,numeric'
ll(distr, x)

Arguments

df1, df2

numeric. The distribution degrees of freedom parameters.

distr

an object of class Fisher.

x

For the density function, x is a numeric vector of quantiles. For the moments functions, x is an object of class Fisher. For the log-likelihood functions, x is the sample of observations.

log, log.p

logical. Should the logarithm of the probability be returned?

q

numeric. Vector of quantiles.

lower.tail

logical. If TRUE (default), probabilities are P(X \leq x), otherwise P(X > x).

p

numeric. Vector of probabilities.

n

number of observations. If length(n) > 1, the length is taken to be the number required.

Details

The probability density function (PDF) of the F-distribution is given by:

f(x; d_1, d_2) = \frac{\sqrt{\left(\frac{d_1 x}{d_1 x + d_2}\right)^{d_1} \left(\frac{d_2}{d_1 x + d_2}\right)^{d_2}}}{x B(d_1/2, d_2/2)}, \quad x > 0 .

Value

Each type of function returns a different type of object:

  • Distribution Functions: When supplied with one argument (distr), the d(), p(), q(), r(), ll() functions return the density, cumulative probability, quantile, random sample generator, and log-likelihood functions, respectively. When supplied with both arguments (distr and x), they evaluate the aforementioned functions directly.

  • Moments: Returns a numeric, either vector or matrix depending on the moment and the distribution. The moments() function returns a list with all the available methods.

  • Estimation: Returns a list, the estimators of the unknown parameters. Note that in distribution families like the binomial, multinomial, and negative binomial, the size is not returned, since it is considered known.

  • Variance: Returns a named matrix. The asymptotic covariance matrix of the estimator.

See Also

Functions from the stats package: df(), pf(), qf(), rf()

Examples

# -----------------------------------------------------
# Fisher Distribution Example
# -----------------------------------------------------

# Create the distribution
df1 <- 14 ; df2 <- 20
D <- Fisher(df1, df2)

# ------------------
# dpqr Functions
# ------------------

d(D, c(0.3, 2, 10)) # density function
p(D, c(0.3, 2, 10)) # distribution function
qn(D, c(0.4, 0.8)) # inverse distribution function
x <- r(D, 100) # random generator function

# alternative way to use the function
df <- d(D) ; df(x) # df is a function itself

# ------------------
# Moments
# ------------------

mean(D) # Expectation
median(D) # Median
mode(D) # Mode
var(D) # Variance
sd(D) # Standard Deviation
skew(D) # Skewness
kurt(D) # Excess Kurtosis
entro(D) # Entropy

# List of all available moments
mom <- moments(D)
mom$mean # expectation

# ------------------
# Point Estimation
# ------------------

ll(D, x)
llf(x, df1, df2)


joker documentation built on June 8, 2025, 12:12 p.m.