udt: UNU.RAN object for Student t distribution

udtR Documentation

UNU.RAN object for Student t distribution

Description

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

[Distribution] – t (Student).

Usage

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 t distribution with df = n degrees of freedom has density

f(x) = Gamma((n+1)/2) / (sqrt(n pi) Gamma(n/2)) (1 + x^2/n)^-((n+1)/2)

for all real x. It has mean 0 (for n > 1) and variance n/(n-2) (for n > 2).

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

Value

An object of class "unuran.cont".

Author(s)

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

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.

See Also

unuran.cont.

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)


Runuran documentation built on Jan. 17, 2023, 5:17 p.m.