MultiVarRand

버전 1.0.0 (3.21 KB) 작성자: Ba Mo
This function generates random values, for multiple correlated variables but with different distributions
다운로드 수: 32
업데이트 날짜: 2019/5/16

라이선스 보기

By Baraa Mohandes
This function generates random values, for multiple correlated variables but with different distributions
var = MultiVarRand(distribs,rho,n,yes_plot)

distribs: a cell-vector describing the distribution of each variable.
each variable is represented by one cell in the vector
inside this one cell, are the descriptors of the distribution
first element in the cell must be the NAME of the distribution, from the list of MATLAB accepted distributions
all remaining elements in the cell are parameters of the distribution
each cell describing one variable's distribution, must be a number of cells (because the name of distribution is a character string)

Example:
distribs ={
{'beta',15,25}; % first variable has a beta distribution with parameters 15, 25
{'rayl',2}; % second variable has a rayleigh distribution with parameter 2
{'wbl',5,10}; % third variable has a weibull distribution with parameters 5, 10
{'norm',5,0.2}; % fourth variable has a normal distribution with parameters 5, 0.2
};

rho: The covariance matrix between the variables. invalid matrices will return an error
A numerical array of 3 columns, of the form: [index of first variable, index of second variable, correlation factor]

Example:
rho = [
1 2 .81
3 1 -0.5
3 2 -0.6
];

Variables 1 and 2 have a correlation factor of 0.81
Variables 1 and 3 have a correlation factor of -0.6
Variable 4 has no correlation with any other variables

n: Number of samples. a scalar

yes_plot: Logical argument. ture = produce demonstrative plots of data, and print the list of correlation factors

Example:
distribs ={
{'beta',15,25};
{'rayl',2};
{'wbl',5,10};
};
rho = [
1 2 .81
3 1 -0.5
3 2 -0.6
];
n=5000;
MultiVarRand(distribs,rho,n,true);

인용 양식

Ba Mo (2024). MultiVarRand (https://www.mathworks.com/matlabcentral/fileexchange/71557-multivarrand), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2018a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0