define beta distribution function
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Saurabh Agarwal
le 30 Avr 2020
Réponse apportée : Ameer Hamza
le 30 Avr 2020
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 commentaires
Réponse acceptée
Ameer Hamza
le 30 Avr 2020
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 commentaires
Plus de réponses (0)
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!