Last chance! 50% off unlimited learning
Sale ends in
Random number generation from the multivariate Slash distribution.
rmslash(n = 1, center = rep(0, nrow(Scatter)), Scatter = diag(length(center)),
df = 2)
the number of samples requested
a vector giving the locations of each variable
a positive-definite dispersion matrix
degrees of freedom (positive, maybe non-integer)
If n = 1
a vector of the same length as center
, otherwise a
matrix of n
rows of random vectors.
The function rmslash
is an interface to C routines, which make calls to
subroutines from LAPACK. The matrix decomposition is internally done using
the Cholesky decomposition. If Scatter
is not non-negative definite then
there will be a warning message.
Devroye, L. (1986). Non-Uniform Random Variate Generation. Springer-Verlag, New York.
# NOT RUN {
# dispersion parameters
Scatter <- matrix(c(10,3,3,2), ncol = 2)
Scatter
# generate the sample
y <- rmslash(n = 1000, Scatter = Scatter)
# scatterplot of a random bivariate slash sample with center
# vector zero and scale matrix 'Scatter'
par(pty = "s")
plot(y, xlab = "", ylab = "")
title("bivariate slash sample (df = 2)", font.main = 1)
# }
Run the code above in your browser using DataLab