how to generate random numbers with a specified lognormal distribution in R?

后端 未结 1 1203
清酒与你
清酒与你 2021-01-06 02:17

I would like to get 20 randomly generated numbers from a lognormal distribution with the geometric mean of 10 and geometric standard deviation of 2.5.

Which R func

相关标签:
1条回答
  • 2021-01-06 02:42

    The rlnorm function:

    rlnorm(20, log(10), log(2.5))
    

    More generally distributions in R are generally available in d,p,q,r forms with those letters coming first followed by the distribution stem: norm, lnorm, unif, gamma, ... etc. Their help pages will contain the specifics of the parameters, which can be essential if working with weibull or other distribution for which conventions are not completely standardized (as it were).

    0 讨论(0)
提交回复
热议问题