1. Posts in the subject areas are now being moderated. Please do not post any details about your exam for at least 3 working days. You may not see your post appear for a day or two. See the 'Forum help' thread entitled 'Using forums during exam period' for further information. Wishing you the best of luck with your exams.
    Dismiss Notice

How did the author arrive at the equation for reverse weibull and quantile functions?

Discussion in 'CS2' started by vidhya36, Jan 28, 2019.

  1. vidhya36

    vidhya36 Very Active Member

    In page 22 of chapter 6, I see a R snippet stating, we can define the aforementioned functions from first principles and the author went on to put up the equations.

    rweibull: (log(1-runif(n))/c) ^ (1/g)
    qweibull: (log(1-p)/c) ^ (1/g)

    I understand the other two pweibull and dweibull.
    (I understand runiform gives samples from uniform distribution. I just need to understand the concept here as how he/she arrived at this.)
    If any one can guide me to a source or help me understand the derivation, it would be great.

    TIA
     
  2. Game_of_Life

    Game_of_Life Member

    One way of generating a random sample from a distribution is to generate a random sample from a Uniform(0,1) distribution and put those numbers into the inverse of the required CDF. (The CDF has range 0->1 and the inverse of the CDF takes the values in that range generated by the random Uniform sample and turns it into a random sample from the required distribution). To read more about it see the following link:

    https://en.wikipedia.org/wiki/Inverse_transform_sampling

    Hence the rweibull is taking a random sample from the Uniform distribution and putting into the inverse of the Weibull CDF (rearrange the CDF to get in terms of x). That being said, I think it should be dividing by minus c not just c (or put the minus somewhere else in that step).

    The q function is similar in that it is also using the inverse of the CDF. The CDF takes a number c and turns it into the probability P(X <= c). The q function takes probabilities and outputs the value of c, i.e. it is just the inverse of the Weibull CDF. However I think that again a minus sign is missing.
     
    vidhya36 likes this.
  3. vidhya36

    vidhya36 Very Active Member

    Thanks, I think I got the concept correct.
     

Share This Page