udt function

UNU.RAN object for Student t distribution

UNU.RAN object for Student t distribution

Create UNU.RAN object for a Student t distribution with with df degrees of freedom.

[Distribution] -- t (Student).

udt(df, lb=-Inf, ub=Inf)

Arguments

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

Details

The tt distribution with df =n= n degrees of freedom has density

f(x)=Γ((ν+1)/2)πνΓ(ν/2)(1+x2/ν)(ν+1)/2f(x)=Gamma((n+1)/2)/(sqrt(npi)Gamma(n/2))(1+x2/n)((n+1)/2) f(x) = \frac{\Gamma ((\nu+1)/2)}{\sqrt{\pi \nu} \Gamma (\nu/2)}(1 + x^2/\nu)^{-(\nu+1)/2}f(x) = Gamma((n+1)/2) / (sqrt(n pi) Gamma(n/2)) (1 + x^2/n)^-((n+1)/2)

for all real xx. It has mean 00 (for n>1n > 1) and variance n/(n2)n/(n-2) (for n>2n > 2).

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. 28, p. 362.

Author(s)

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

Examples

## Create distribution object for t distribution distr <- udt(df=4) ## 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