How to generate a random sequence with some specific probability
이전 댓글 표시
How to generate a random sequence with some specific probability except the randn for normal and rand for uniform distribution?
답변 (2개)
Image Analyst
2018년 2월 22일
0 개 추천
Here are a ton of them:
Is the one you want in that list? If not, you'll have to use inverse transform sampling, like my attached example, and described here in Wikipedia.
Walter Roberson
2018년 2월 22일
0 개 추천
and in particular https://www.mathworks.com/help/stats/makedist.html and https://www.mathworks.com/help/stats/random.html
If you want to sample unequally from a specific list of values, then use randsample() and use the W (weight) parameter.
댓글 수: 2
Huiwen Wu
2018년 2월 22일
Walter Roberson
2018년 2월 23일
See https://www.mathworks.com/help/stats/nonparametric-and-empirical-probability-distributions.html for functions to create empirical distributions from data.
"User-defined custom distributions, created using files and function handles, are supported by the Statistics and Machine Learning Toolbox™ functions pdf, cdf, icdf, and mle, and the Statistics and Machine Learning Toolbox Distribution Fitter app."
카테고리
도움말 센터 및 File Exchange에서 Piecewise Linear Distribution에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!