studentdistribution: The Student Distribution

density_tR Documentation

The Student Distribution

Description

Probability Density Function (PDF), Cumulative Density Function (CDF) and generation of random variables following a Student distribution.

Usage

density_t(df, x)

cdf_t(df, x)

random_t(df, n)

Arguments

df

degrees of freedom.

x

vector of quantiles.

n

number of observations.

Value

The functions density_XXX and cdf_t return numeric vectors of same length as x. The functions random_XXX return random number (numeric vectors) of length n.

Examples


# Probability density function of T with 2 degrees of freedom.
z <- density_t(df = 2, .01 * seq(-100, 100, 1))
# Generating a random vector with each component drawn from a T(2) distribution
z <- random_t(2, 100)
# Computing the probabilty that the random variable X following a T distribution
# with df degrees of freedom is lower than x
z <- cdf_t(df = 12, x = 1.2)
z
z <- cdf_t(df = 12, x = c(0:10)) # array of values
z


rjd3toolkit documentation built on Jan. 14, 2026, 1:06 a.m.