Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Random Number Generator - Extreme value distribution (Gumbel), log logistic, log normal...

    Dear All,

    I am writing to ask something about more advanced random number generator. I would like to generate a random sample from gumbel distribution/ log logistic distribution/ log normal distribution. I only find log normal from the user-written command -rnd-, but not for the rest. Does anyone know how I can generate random samples from these distributions or is there any other user-written command I could use to generate?

    Thank you very much! I look forward to hearing from you!
    Long

  • #2
    Long Stata: Please change your identifier to a real name. http://www.statalist.org/forums/help#realnames

    The lognormal is easy: just use exp(rnormal())

    The Gumbel is just a matter of wrapping the quantile function around a call to runiform().

    I make that


    Code:
    gen rgumbel = <mu> -  <alpha> * log(-log(runiform()))
    where <mu> and <alpha> are place-holders for constants or variables, as the case may be.

    The log-logistic I would approach in the same way, but I haven't done the algebra.

    Comment


    • #3
      "Long Stata": as Nick says, you can do this relatively easily from first principles. Have a look at the "random number generation" sections of a book such as "Statistical Distributions" (third edition), by M Evans, N Hastings, B Peacock, Wiley 2000. (There may be a later edition.) The Gumbel distribution is discussed in Chapter 16

      Comment


      • #4
        There is a fourth edition. http://www.amazon.com/Statistical-Di.../dp/0470390638

        Comment


        • #5
          Thank you Nick and Stephen for the advice! I am sorry I did not figure out how to change my name so I created a new one. - Best, Long
          Last edited by Long Hong; 17 Oct 2015, 08:03.

          Comment

          Working...
          X