Generate random samples from the inverted matrix variate t distribution or compute densities.
rmatrixinvt(
n,
df,
mean,
L = diag(dim(as.matrix(mean))[1]),
R = diag(dim(as.matrix(mean))[2]),
U = L %*% t(L),
V = t(R) %*% R,
list = FALSE,
array = NULL
)dmatrixinvt(
x,
df,
mean = matrix(0, p, n),
L = diag(p),
R = diag(n),
U = L %*% t(L),
V = t(R) %*% R,
log = FALSE
)
rmatrixinvt
returns either a list of \(n\)
\(p \times q\) matrices or a \(p \times q \times n\) array.
dmatrixinvt
returns the density at x
.
number of observations for generation
degrees of freedom (\(>0\), may be non-integer),
df = 0, Inf
is allowed and will return a normal distribution.
\(p \times q\) This is really a 'shift' rather than a mean, though the expected value will be equal to this if \(df > 2\)
\(p \times p\) matrix specifying relations among the rows. By default, an identity matrix.
\(q \times q\) matrix specifying relations among the columns. By default, an identity matrix.
\(LL^T\) - \(p \times p\) positive definite matrix for rows, computed from \(L\) if not specified.
\(R^T R\) - \(q \times q\) positive definite matrix for columns, computed from \(R\) if not specified.
Defaults to FALSE
. If this is TRUE
, then the
output will be a list of matrices.
If \(n = 1\) and this is not specified and list
is
FALSE
, the function will return a matrix containing the one
observation. If \(n > 1\) , should be the opposite of list
.
If list
is TRUE
, this will be ignored.
quantile for density
logical; in dmatrixt
, if TRUE
, probabilities
p
are given as log(p)
.
Gupta, Arjun K, and Daya K Nagar. 1999. Matrix Variate Distributions. Vol. 104. CRC Press. ISBN:978-1584880462
Dickey, James M. 1967. “Matricvariate Generalizations of the Multivariate t Distribution and the Inverted Multivariate t Distribution.” Ann. Math. Statist. 38 (2): 511–18. tools:::Rd_expr_doi("10.1214/aoms/1177698967")
rmatrixnorm()
, rmatrixt()
,
and stats::Distributions()
.
# an example of drawing from the distribution and computing the density.
A <- rmatrixinvt(n = 2, df = 10, diag(4))
dmatrixinvt(A[, , 1], df = 10, mean = diag(4))
Run the code above in your browser using DataLab