dmt: Multivariate t distribution

Description Usage Arguments Details Value References See Also Examples

View source: R/density.r

Description

The probability density function and distribution function for the multivariate Student t distribution and mixtures of multivariate t distribution

Usage

1
2
3
dmt(dat, mu, sigma, dof = Inf, log = FALSE)
pmt(dat, mu=rep(0,length(dat)), sigma=diag(length(dat)), dof=Inf, method=1, ...)  
dfmmt(dat, mu = NULL, sigma = NULL, dof = NULL, pro = NULL, known = NULL)

Arguments

dat

for dmt, this is the data matrix giving the coordinates of the point(s) where the density is evaluated. for pmt, this is either a vector of length p. Currently, only p up to 20 dimensions is supported.

mu

a numeric vector of length p representing the location parameter;

sigma

a numeric positive definite matrix with dimension (p,p) representing the scale parameter

dof

a positive real number specifying the degrees of freedom. If tmethod=1, dof will be rounded to the nearest integer.

pro

the mixing proportions; for dmt, this is equal to 1; for dfmmt, this is vector of length of g specifying the mixing proportions for each component.

log

a logical value; if TRUE, the logarithm of the density is computed

...

parameters passed to sadmvt, among maxpts, absrel, releps

known

a list containing the parameters of the model. If specified, it overwrites the values of mu, sigma, dof and pro.

method

the method to use for computation of t distribution function. See description.

Details

There are three options in pmt for computing multivariate t distribution function values. method=1 uses requires dof to be an integer. This provide interfaces to the Fortran-77 routines by Alan Genz. This is the fastest method of the three options avilable. method=2 uses linear interpolation technique to calculate t distribution function values for a positive real dof. This method requires double the time of method 1. method=3 uses a method described in Genz and Bretz (2002). This is the more accurate method for a non-integer dof, but more computationally intensive than the other two methods.

Value

The function dmt computes the density value of a specified multivariate t distribution. pmt computes the distribution value for a SINGLE point. dfmmt returns a numeric vector of mixture density values.

References

Genz, A.: Fortran code in files mvt.f and mvtdstpack.f available at http://www.math.wsu.edu/math/faculty/genz/software/

Genz, A. and Bretz, F. (2002). Comparison of Methods for the Numerical Computation of Multivariate t Probabilities. J. of Comput. Graph. Stat., 11:950-971,

See Also

dmst, dfmmst

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
x <- seq(-2,4,length=21)
y <- 2*x+10
z <- x+cos(y)
mu <- c(1,12,2)
sigma <- matrix(c(1,2,0,2,5,0.5,0,0.5,3), 3, 3)
dof <- 4
f  <- dmt(cbind(x,y,z), mu, sigma,dof)
## Not run:                       
p1 <- pmt(c(2,11,3), mu, sigma, dof)
p2 <- pmt(c(2,11,3), mu, sigma, dof, maxpts=10000, abseps=1e-8)

## End(Not run)

obj <- list()
obj$mu <- list(c(17,19), c(5,22), c(6,10))
obj$sigma <- list(diag(2), matrix(c(2,0,0,1),2), matrix(c(3,7,7,24),2))
obj$dof <- c(1, 2, 3)
obj$pro <- c(0.25, 0.25, 0.5)
dfmmt(matrix(c(1,2,5,6,2,4),3,2), obj$mu, obj$sigma, obj$dof, obj$pro)
dfmmt(c(1,2), known=obj)

EMMIXuskew documentation built on May 29, 2017, 11:25 p.m.