cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

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

HusseinNaserald
1-Newbie

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

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 3

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

Alan

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?

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

Top Tags