udf function

UNU.RAN object for F distribution

UNU.RAN object for F distribution

Create UNU.RAN object for an F distribution with mean with df1 and df2 degrees of freedom.

[Distribution] -- F.

udf(df1, df2, lb=0, ub=Inf)

Arguments

  • df1, df2: (strictly positive) degrees of freedom. Non-integer values allowed.
  • lb: lower bound of (truncated) distribution.
  • ub: upper bound of (truncated) distribution.

Details

The F distribution with df1 = n1n1 and df2 =

n2n2 degrees of freedom has density

f(x)=Γ(n1/2+n2/2)Γ(n1/2)Γ(n2/2)(n1n2)n1/2xn1/21(1+n1xn2)(n1+n2)/2f(x)=Gamma((n1+n2)/2)/(Gamma(n1/2)Gamma(n2/2))(n1/n2)(n1/2)x(n1/21)(1+(n1/n2)x)((n1+n2)/2) f(x) = \frac{\Gamma(n_1/2 + n_2/2)}{\Gamma(n_1/2)\Gamma(n_2/2)}\left(\frac{n_1}{n_2}\right)^{n_1/2} x^{n_1/2 -1}\left(1 + \frac{n_1 x}{n_2}\right)^{-(n_1 + n_2) / 2}f(x) = Gamma((n1 + n2)/2) / (Gamma(n1/2) Gamma(n2/2)) * (n1/n2)^(n1/2) x^(n1/2 - 1) * (1 + (n1/n2) x)^(-(n1 + n2)/2)

for x>0x > 0.

The domain of the distribution can be truncated to the interval (lb,ub).

Returns

An object of class "unuran.cont".

See Also

unuran.cont.

References

N.L. Johnson, S. Kotz, and N. Balakrishnan (1995): Continuous Univariate Distributions, Volume 2. 2nd edition, John Wiley & Sons, Inc., New York. Chap. 27, p. 332

Author(s)

Josef Leydold and Wolfgang H"ormann unuran@statmath.wu.ac.at .

Examples

## Create distribution object for F distribution distr <- udf(df1=3,df2=6) ## Generate generator object; use method PINV (inversion) gen <- pinvd.new(distr) ## Draw a sample of size 100 x <- ur(gen,100)
  • Maintainer: Josef Leydold
  • License: GPL (>= 2)
  • Last published: 2025-04-07