matlab ⽣成多元随机数
Multivariate normal random numbers Multivariate t random numbers
在函数库⾥只到了多元正态分布和多元t分布(没有多元卡⽅分布,哎。。。)
摘抄下来,以便之后学习和应⽤
多元正态随机数
mvnrnd
Syntax
R = mvnrnd(MU,SIGMA)
r = mvnrnd(MU,SIGMA,cases)
Description
R = mvnrnd(MU,SIGMA) returns an n-by-d matrix R of random vectors chosen from the multivariate no
rmal distribution with mean MU, and covariance SIGMA. MU is a vector or n-by-d matrix, andmvnrnd generates each row of R using the corresponding row of mu. SIGMA is a d-by-d symmetric positive semi-definite matrix, or a d-by-d-by-n array. If SIGMA is an array, mvnrnd generates each row of R using the corresponding page of SIGMA, i.e., mvnrnd computes R(i,:) using MU(i,:) and SIGMA(:,:,i). If the covariance matrix is diagonal, containing variances along the diagonal and zero covariances off the diagonal, SIGMA may also be specified as a 1-by-d vector or a 1-by-d-by-n array, containing just the diagonal. If MU is a 1-by-d vector, mvnrnd replicates it to match the trailing dimension of SIGMA.
r = mvnrnd(MU,SIGMA,cases) returns a cases-by-d matrix R of random vectors chosen from the multivariate normal distribution with a common 1-by-d mean vector MU, and a common d-by-dcovariance matrix SIGMA.多元t 分布随机数
mvtrnd
matlab生成随机数Syntax R = mvtrnd(C,df,cases)
R = mvtrnd(C,df)
Description
R = mvtrnd(C,df,cases) returns a matrix of random numbers chosen from the multivariate t distribution, where C is a correlation matrix. df is the degrees of freedom and is either a scalar or is a vector with cases elements. If p is the number of columns in C, then the output R has cases rows and p columns.
Let t represent a row of R. Then the distribution of t is that of a vector having a multivariate normal distribution with mean 0, variance 1, and covariance matrix C, divided by an independent chi-square random value having df degrees of freedom. The rows of R are independent.
C must be a square, symmetric and positive definite matrix. If its diagonal elements are not all 1 (that is, if C is a covariance matrix rather than a correlation matrix), mvtrnd rescales C to transform it to a correlation matrix before generating the random numbers.
R = mvtrnd(C,df) returns a single random number from the multivariate t distribution.
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论