matlab生成多元随机数

在函数库里只找到了多元正态分布和多元t分布(没有多元卡方分布,哎。。。)

摘抄下来,以便之后学习和应用

多元正态随机数

mvnrnd

Multivariate normal random numbers

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 normal distribution with mean MU, and covariance SIGMAMU is a vector or n-by-d matrix, andmvnrnd generates each row of R using the corresponding row of muSIGMA 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

Multivariate t random numbers

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.




  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值