define beta distribution function
조회 수: 9 (최근 30일)
이전 댓글 표시
how to define N=100000 random variables in beta distribution with (an=0, bn=1) mu(mean)=0.37 sigma(standard deviation)=0.07
댓글 수: 0
채택된 답변
Ameer Hamza
2020년 4월 30일
You cannot independently choose the a, b parameters, and mu, sigma. You can only choose one pair at a time. Also, parameter an=0 and bn=1 only generate constant zero, so I suppose you wrote that by mistake. The following shows how to generate random beta numbers with mean=0.37 and std=0.07. It uses formula from this line: https://en.wikipedia.org/wiki/Beta_distribution#Mean_and_variance
mu = 0.37;
std = 0.07;
var = std.^2;
v = mu*(1-mu)/var-1;
a = mu*v;
b = (1-mu)*v;
N = 100000;
r = betarnd(a, b, N, 1);
댓글 수: 0
추가 답변 (0개)
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!