Search code examples
matlabstatisticsdistributionprobability-theoryweibull

Sample mean and variance of a Weibull distribution sample


Let's suppose that I have a random sample x from a Weibull distribution with shape parameter k=1 and scale parameter λ=2.
How am I supposed to compute the mean value of the sample? Also what can I do to compute the variance of the sample?

I would also appreciate any helpful Matlab code able to perform the aforementioned tasks.


Solution

  • Random numbers for Weibul distribution with scale parameter λ and shape parameter k:

    Numbers = wblrnd(λ,k);
    

    To compute the mean

    mean(Numbers(:));
    

    To compute the variance

    var(Numbers(:));