Random number generator based on probability distribution
7 views (last 30 days)
Show older comments
1) What are the formulas for function 'random' and 'wblrnd' to generate the random numbers? assuming that I need these formula for coding in C++.
2) What are the differences between random numbers generated from function 'random' and 'wblrnd' for Weibull distribution?
3) It seems that MATLAB only supported 'random' function for Log Logistic Distribution. Is there any other formula to generate random numbers for Log Logistic Distribution? assuming that I need this formula for coding in C++
0 Comments
Answers (1)
Youssef Khmou
on 7 Mar 2013
Edited: Youssef Khmou
on 7 Mar 2013
hi,
1)Concerning C/C++ there is function rand() in h file "math.h", but i am sure there are other statistical libraries to download, for generating Rnd variables .
2) For Mathworks try :
doc random
a=rand(N,M);
a=randn(N,M);
a=random(Name,a) where Name is :
'beta' (Beta distribution)'bino' (Binomial distribution)'chi2' (Chi-square distribution)'exp' (Exponential distribution)'ev' (Extreme value distribution)'f' (F distribution)'gam' (Gamma distribution)'gev' (Generalized extreme value distribution)'gp' (Generalized Pareto distribution)'geo' (Geometric distribution)'hyge' (Hypergeometric distribution)'logn' (Lognormal distribution)'nbin' (Negative binomial distribution)'ncf' (Noncentral F distribution)'nct' (Noncentral tdistribution)'ncx2' (Noncentral chi-square distribution)'norm' (Normal distribution)'poiss' (Poisson distribution)'rayl' (Rayleigh distribution)'t' (t distribution)'unif' (Uniform distribution)'unid' (Discrete uniform distribution)'wbl' (Weibull distribution)
See Also
Categories
AI, Data Science, and Statistics
Statistics and Machine Learning Toolbox
Probability Distributions
Discrete Distributions
Binomial Distribution
AI, Data Science, and Statistics
Statistics and Machine Learning Toolbox
Probability Distributions
Discrete Distributions
Hypergeometric Distribution
AI, Data Science, and Statistics
Statistics and Machine Learning Toolbox
Probability Distributions
Continuous Distributions
Generalized Extreme Value Distribution
Show more
Find more on Binomial Distribution in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!