betafunction: The function that generates random Numbers with the...

Description Usage Arguments Value Examples

Description

a function to generate a random sample of size n from the Beta(a,b) distribution by the acceptance-rejection method.

Usage

1
betafunction(n, a, b)

Arguments

n

The number of random Numbers generated

a

Parameter of beta distribution

b

Parameter of beta distribution

Value

a random sample of size n

Examples

1
2
3
4
5
6
## Not run: 
sample_beta <- betafunction(1e3,3,2)#record the sample
head(sample_beta,20)
hist(sample_beta)

## End(Not run)

liujin07/StartComp18065 documentation built on May 5, 2019, 11:07 p.m.