udt | R Documentation |
Create UNU.RAN object for a Student t distribution with
with df
degrees of freedom.
[Distribution] – t (Student).
udt(df, lb=-Inf, ub=Inf)
df |
degrees of freedom (strictly positive). Non-integer values allowed. |
lb |
lower bound of (truncated) distribution. |
ub |
upper bound of (truncated) distribution. |
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
).
An object of class "unuran.cont"
.
Josef Leydold and Wolfgang H\"ormann unuran@statmath.wu.ac.at.
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.
unuran.cont
.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.