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;
for pmt, d cannot exceed 20
mean
either a vector of length d, representing the location
parameter (equal to the mean vector when df>1) or a matrix
whose rows represent different mean vectors (except for rmt);
in the matrix case, its dimensions must match those of x
;
S
a symmetric positive-definite matrix representing the
scale matrix of the distribution, such that S*df/(df-2) is
the variance-covariance matrix when df>2; a vector of
length 1 is also allowed (in this case, d=1 is set)
df
degrees of freedom; it must be a positive integer for pmt,
sadmvt and biv.nt.prob, otherwise a positive number.
If df=Inf (default value), the corresponding *mnorm
function is called, unless d=2; in this case
biv.nt.prob is used. If biv.nt.prob is called with
df=Inf, it returns the probability of a rectangle assigned by
a bivariate normal distribution
log
a logical value(default value is FALSE); if TRUE,
the logarithm of the density is computed
sqrt
if not NULL (default value is NULL),
a square root of the intended scale matrix S;
see ‘Details’ for a full description
...
parameters passed to sadmvt,
among maxpts, absrel, releps
n
the number of random vectors to be generated
lower
a numeric vector of lower integration limits of
the density function; must be of maximal length 20;
+Inf and -Inf entries are allowed
upper
a numeric vector of upper integration limits
of the density function; must be of maximal length 20;
+Inf and -Inf entries are allowed
maxpts
the maximum number of function evaluations
(default value: 2000*d)
abseps
absolute error tolerance (default value: 1e-6)
releps
relative error tolerance (default value: 0)
Details
The functions sadmvt 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 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. For examples of use of this argument, see those in the
documentation of rmnorm.
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 does not perform checks on the supplied
arguments.
If, after setting the same seed value to set.seed,
two calls to rmnorm are made with the same arguments except that one
generates n1 vectors and the other n2 vectors, with
n1<n2, then the n1 vectors of the first call coincide with the
initial n2 vectors of the second call.
Value
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 vectors
Note
The attributes error and status of the probability
returned by pmt and sadmvt indicate whether the function
had a normal termination, achieving the required accuracy.
If this is not the case, re-run the function with a higher value of
maxpts
Author(s)
Fortran code of SADMVT and most auxiliary functions by Alan Genz,
some additional auxiliary functions by people referred to within his
program. Interface to R and additional R code by Adelchi Azzalini
Dunnett, C.W. and Sobel, M. (1954).
A bivariate generalization of Student's t-distribution with tables
for certain special cases. Biometrika 41, 153–169.