next up previous
Next: Simulation of an hyper Up: Random laws simulation Previous: Simulation of an exponential

Simulation of a Weibull random variable

Function code:

 
function [y]=Weibull(m,n,alpha,beta)
//------------------------------- 
y=rand(m,n,'uniform')
y= (beta*( - log(1-y)))^(1/alpha)

Simulation code:

n=10000;
y=Weibull(1,n,1,2)
histplot(20,y,[1,1],'061');
\fbox{\epsfig{file=foo0_87.eps,width=3.75in}}

Scilab group