Weibull Distribution Homework: Generating Random Observations from Weibull(k,λ)

  • Thread starter Thread starter squenshl
  • Start date Start date
  • Tags Tags
    Distribution
squenshl
Messages
468
Reaction score
4

Homework Statement


The Weibull distribution is used frequently as a lifetime distribution and is so is used a lot in survival analysis. It can be parameterised as:##f(x;\lambda,k) = \frac{k}{\lambda}\left(\frac{x}{\lambda}\right)^{k-1}e^{-\left(\frac{x}{\lambda}\right)^k}## for ##x\geq 0## & ##0## for ##x < 0##, where ##k > 0## is called the shape parameter and ##\lambda > 0## is called the scale parameter of the distribution.

I have shown that it is a PDF, found the CDF, median value, Variance & failure rate. My question is how would I describe how you would generate random observations from a ##\text{Weibull}(k,\lambda)## distribution from random ##\text{Uniform}(0,1)## observations.

Homework Equations

The Attempt at a Solution


I don't even know where to begin. Please help.
 
Physics news on Phys.org
Hmm. This is something that would usually just be taught, rather than asking the student to derive it, as the answer is not terribly obvious.
I'll try to give a hint that doesn't give the whole thing away.
The desired random variable W will be a function of U where U is a Uniform[0,1] random variable.
Can you think of a suitable function to use that will have the desired properties, given the functions you have worked out above and their properties, including domain and range?
 
squenshl said:

Homework Statement


The Weibull distribution is used frequently as a lifetime distribution and is so is used a lot in survival analysis. It can be parameterised as:##f(x;\lambda,k) = \frac{k}{\lambda}\left(\frac{x}{\lambda}\right)^{k-1}e^{-\left(\frac{x}{\lambda}\right)^k}## for ##x\geq 0## & ##0## for ##x < 0##, where ##k > 0## is called the shape parameter and ##\lambda > 0## is called the scale parameter of the distribution.

Homework Equations

The Attempt at a Solution


I don't even know where to begin. Please help.

Google "Generation of random variable" or "...random variate".
 
andrewkirk said:
Hmm. This is something that would usually just be taught, rather than asking the student to derive it, as the answer is not terribly obvious.
I'll try to give a hint that doesn't give the whole thing away.
The desired random variable W will be a function of U where U is a Uniform[0,1] random variable.
Can you think of a suitable function to use that will have the desired properties, given the functions you have worked out above and their properties, including domain and range?
Oh right. I used the CDF of the Weibull distribution and noted that if ##U## is Uniform, then so is ##1-U## to get the desired result.
 
There are two things I don't understand about this problem. First, when finding the nth root of a number, there should in theory be n solutions. However, the formula produces n+1 roots. Here is how. The first root is simply ##\left(r\right)^{\left(\frac{1}{n}\right)}##. Then you multiply this first root by n additional expressions given by the formula, as you go through k=0,1,...n-1. So you end up with n+1 roots, which cannot be correct. Let me illustrate what I mean. For this...
Back
Top