Skip to main content
1-Visitor
July 11, 2014
Question

Random number generation of Beta distribution on [Z1,Z2] (not [0,1])

  • July 11, 2014
  • 3 replies
  • 1598 views

Hi,

I am interested in generating random numbers from a Beta distribution with parameters a and b, where the generated numbers are distributed on the interval [Z1,Z2] and not [0,1]. I know the latter can be obtained by using rbeta(n,a,b).

Thanks

Hussein

3 replies

19-Tanzanite
July 11, 2014

Z1 + (Z2 - Z1)*rbeta(n,a,b)

Alan

24-Ruby IV
July 12, 2014

AlanStevens wrote:

Z1 + (Z2 - Z1)*rbeta(n,a,b)

Alan

better

rAlanStevens(n, α, β, a, b) := a + (b - a)*rbeta(n, α , β)

I have saw in one sheet 100*runif(n, 0, 1)

And the second.

Do you know why we have rbeta, rgamma but not ralpha?

1-Visitor
July 31, 2014

Thanks. I thought may be Beta has a specific function.