dmt(x, mean = rep(0, d), S, df=Inf, log = FALSE)
pmt(x, mean = rep(0, d), S, df=Inf, ...)
rmt(n = 1, mean = rep(0, d), S, df=Inf, sqrt=NULL)
sadmvt(df, lower, upper, mean, S, maxpts = 2000*d, abseps = 1e-06, releps = 0)
biv.nt.prob(df, lower, upper, mean, S)d
or a matrix with d columns, where d=ncol(S), giving
the coordinates of the point(s) where the density must be evaluated;
for pmt, d cannot exceedd, representing the location
parameter (equal to the mean vector when df>1),
or (except for rmt)
a matrix whose rows represent different location vectors;
if it is a maS*df/(df-2) is
the variance-covariance matrix when df>2; a vector of
length 1 is also allowed (in thpmt,
sadmvt and biv.nt.prob, otherwise a positive number.
If df=Inf (default value), the corresponding *mnorm
function FALSE); if TRUE,
the logarithm of the density is computedNULL (default value is NULL),
a square root of the intended scale matrix S;
see sadmvt,
among maxpts, absrel, releps20;
+Inf and -Inf entries are allowed20;
+Inf and -Inf entries are allowed2000*d)1e-6)0)dmt returns a vector of density values (possibly log-transformed);
pmt and sadmvt return a single probability with
attributes giving details on the achieved accuracy, provided x
of pmnorm is a vector;
rmt returns a matrix of n rows of random vectorssadmvt and biv.nt.prob are interfaces to
Fortran-77 routines by Alan Genz, and available from his web page;
they makes uses of some auxiliary functions whose authors are
documented in the Fortran code. The routine sadmvt uses an adaptive
integration method. The routine biv.nt.prob is specific for the
bivariate case; if df<1< code=""> or df=Inf, it computes the bivariate
normal distribution function using a non-iterative method described in a
reference given below.
If pmt is called with d>2, this is converted into
a suitable call to sadmvt; if d=2, a call to
biv.nt.prob is used; if d=1, then pt is used.
If sqrt=NULL (default value), the working of rmt involves
computation of a square root of S via the Cholesky decomposition.
If a non-NULL value of sqrt is supplied, it is assumed that
it represents a square root of the scale matrix,
otherwise represented by S, whose value is ignored in this case.
This mechanism is intended primarily for use in a sequence of calls to
rmt, all sampling from a distribution with fixed scale matrix;
a suitable matrix sqrt can then be computed only once beforehand,
avoiding that the same operation is repeated multiple times along the
sequence of calls.
Another use of sqrt is to supply a different form of square root
of the scale matrix, in place of the Cholesky factor.
If sqrt=NULL (default value), the working of rmnorm involves
computation of a square root of S via the Cholesky decomposition.
If a non-NULL value of sqrt is supplied, it is assumed
that it represents a matrix, R say, such that R' R
represents the required scale matrix of the distribution;
in this case, the argument S is ignored.
This mechanism is intended primarily for use in a sequence of calls to
rmt, all sampling from a distribution with fixed scale matrix;
a suitable matrix sqrt can then be computed only once beforehand,
avoiding that the same operation is repeated multiple times along the
sequence of calls.
Another use of sqrt is to supply a different form of square root
of the scale matrix, in place of the Cholesky factor.
For efficiency reasons, rmt performs limited check on the supplied
arguments.
1<>mvt.f and mvtdstpack.f
available at dt,
dmnorm for use of argument sqrtx <- 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)
df <- 4
f <- dmt(cbind(x,y,z), mu, Sigma,df)
p1 <- pmt(c(2,11,3), mu, Sigma, df)
p2 <- pmt(c(2,11,3), mu, Sigma, df, maxpts=10000, abseps=1e-8)
x <- rmt(10, mu, Sigma, df)
p <- sadmvt(df, lower=c(2,11,3), upper=rep(Inf,3), mu, Sigma) # upper tail
#
p0 <- pmt(c(2,11), mu[1:2], Sigma[1:2,1:2], df=5)
p1 <- biv.nt.prob(5, lower=rep(-Inf,2), upper=c(2, 11), mu[1:2], Sigma[1:2,1:2])
p2 <- sadmvt(5, lower=rep(-Inf,2), upper=c(2, 11), mu[1:2], Sigma[1:2,1:2])
c(p0, p1, p2, p0-p1, p0-p2)Run the code above in your browser using DataLab