- statistics: r = mvtrnd (rho, df)
- statistics: r = mvtrnd (rho, df, n)
Random vectors from the multivariate Student’s t distribution.
Arguments
-
rho is the matrix of correlation coefficients. If there are any
non-unit diagonal elements then rho will be normalized, so that the
resulting covariance of the obtained samples r follows:
cov (r) = df/(df-2) * rho ./ (sqrt (diag (rho) * diag (rho)))
.
In order to obtain samples distributed according to a standard multivariate
student’s t-distribution, rho must be equal to the identity matrix. To
generate multivariate student’s t-distribution samples r with arbitrary
covariance matrix rho, the following scaling might be used:
r = mvtrnd (rho, df, n) * diag (sqrt (diag (rho)))
.
-
df is the degrees of freedom for the multivariate t-distribution.
df must be a vector with the same number of elements as samples to be
generated or be scalar.
-
n is the number of rows of the matrix to be generated. n must be
a non-negative integer and corresponds to the number of samples to be
generated.
Return values
-
r is a matrix of random samples from the multivariate t-distribution
with n row samples.
Examples
| rho = [1, 0.5; 0.5, 1];
df = 3;
n = 10;
r = mvtrnd (rho, df, n);
rho = [1, 0.5; 0.5, 1];
df = [2; 3];
n = 2;
r = mvtrnd (rho, df, 2);
|
References
-
Wendy L. Martinez and Angel R. Martinez. Computational Statistics
Handbook with MATLAB. Appendix E, pages 547-557, Chapman & Hall/CRC, 2001.
-
Samuel Kotz and Saralees Nadarajah. Multivariate t Distributions and
Their Applications. Cambridge University Press, Cambridge, 2004.
See also:
mvtcdf,
mvtcdfqmc,
mvtpdf
Source Code:
mvtrnd