Random number generator based on probability distribution

7 views (last 30 days)
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++

Answers (1)

Youssef  Khmou
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)
  1 Comment
Dua
Dua on 7 Mar 2013
TQ for sharing. Please explain and help me to understand more about probability distribution. Based on the list of distribution given in your answer, my questions are: how to differentiate the functionality and purposes of each distribution? What are the applications and when to use each distribution? Where can I get simple examples for the distributions. For instance, what is the difference between the random numbers generated through Laplace distribution, Log Logistic distribution or Power distribution?

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!