Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mtrunct

The multivariate truncated Student's t distribution


Description

The probability density function and the distribution function of the multivariate truncated Student's t distribution

Usage

dmtrunct(x, mean, S, df, lower, upper, log = FALSE, ...)
pmtrunct(x, mean, S, df, lower, upper, ...)

Arguments

x

either a vector of length d or a matrix with d columns, where d=ncol(S), giving the coordinates of the point(s) where the density must be evaluated.

mean

either a vector of length d, representing the location parameter (equal to the mean vector when df>1) of the pre-truncation distribution or a matrix whose rows represent different mean vectors; in the matrix case, its dimensions must match those of x.

S

a symmetric positive-definite matrix representing the scale matrix, such that S*df/(df-2) is the variance-covariance matrix of the pre-truncation distribution when df>2.

df

degrees of freedom; it must be a positive integer

lower

a vector representing the lower truncation values of the component variables; -Inf values are allowed. If missing, it is set equal to rep(-Inf, d).

upper

a vector representing the upper truncation values of the component variables; Inf values are allowed. If missing, it is set equal to rep(Inf, d).

log

a logical value (default value is FALSE); if TRUE, the logarithm of the density is computed.

...

arguments passed to sadmvt, among maxpts, absrel, releps.

Details

The dimension d cannot exceed 20.

Value

a numeric vector

Author(s)

Adelchi Azzalini

See Also

sadmvt for regulating accuracy

Examples

m2 <- c(0.5, -1)
V2 <- matrix(c(1.5, -1.75, -1.75, 3), 2, 2)
lower <- a <- c(-1, -2.5)
upper <- b <- c(2, 1)
set.seed(1) 
points <- matrix(runif(10, -3, 3), nrow=5, ncol=2)
pdf <- dmtrunct(points, mean=m2, S=V2, df=4, lower, upper) 
cdf <- pmtrunct(points, mean=m2, S=V2, df=4, lower, upper)

mnormt

The Multivariate Normal and t Distributions, and Their Truncated Versions

v2.0.2
GPL-2 | GPL-3
Authors
Adelchi Azzalini [aut, cre], Alan Genz [aut] (most Fortran code), Alan Miller [ctb] (Fortran routine PHI), Michael J. Wichura [ctb] (Fortran routine PHINV), G. W. Hill [ctb] (Fortran routine STDINV), Yihong Ge [ctb] (Fortran routines BNVU and MVBVU).
Initial release
2020-08-31

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.