tmvt function

Multivariate truncated Student distribution

Multivariate truncated Student distribution

Density, distribution function and random generation for the multivariate truncated Student distribution with location vector mu, scale matrix sigma, lower truncation limit lb, upper truncation limit ub and degrees of freedom df.

Arguments

  • n: number of observations
  • x, q: vector or matrix of quantiles
  • B: number of replications for the (quasi)-Monte Carlo scheme
  • log: logical; if TRUE, probabilities and density are given on the log scale.
  • mu: vector of location parameters
  • sigma: scale matrix
  • df: degrees of freedom
  • lb: vector of lower truncation limits
  • ub: vector of upper truncation limits
  • type: string, either of mc or qmc for Monte Carlo and quasi Monte Carlo, respectively

Returns

dtmvt gives the density, ptmvt gives the distribution function, rtmvt generate random deviates.

Details

The truncation limits can include infinite values. The Monte Carlo (type = "mc") uses a sample of size B, while the qausi Monte Carlo (type = "qmc") uses a pointset of size ceiling(n/12) and estimates the relative error using 12 independent randomized QMC estimators.

pmvt computes an estimate and a deterministic upper bound of the distribution function of the multivariate normal distribution. Infinite values for vectors uu and ll are accepted. The Monte Carlo method uses sample size nn: the larger nn, the smaller the relative error of the estimator.

Usage

dtmvt(x, mu, sigma, df, lb, ub, type = c("mc", "qmc"), log = FALSE, B = 1e4)
ptmvt(q, mu, sigma, df, lb, ub, type = c("mc", "qmc"), log = FALSE, B = 1e4)
rtmvt(n, mu, sigma, df, lb, ub)
pmvt(mu, sigma, df, lb = -Inf, ub = Inf, type = c("mc", "qmc"), B = 1e4)

Examples

d <- 4; lb <- rep(0, d) mu <- runif(d) sigma <- matrix(0.5, d, d) + diag(0.5, d) samp <- rtmvt(n = 10, mu = mu, sigma = sigma, df = 2, lb = lb) loglik <- dtmvt(samp, mu = mu, sigma = sigma, df = 2, lb = lb, log = TRUE) cdf <- ptmvt(samp, mu = mu, sigma = sigma, df = 2, lb = lb, log = TRUE, type = "q")

References

Z. I. Botev and P. L'Ecuyer (2015), Efficient probability estimation and simulation of the truncated multivariate Student-t distribution, Proceedings of the 2015 Winter Simulation Conference, pp. 380-391

Author(s)

Leo Belzile, R port from Matlab code by Z. I. Botev

  • Maintainer: Leo Belzile
  • License: GPL-3
  • Last published: 2024-07-08

Useful links