gene_beta: A beta(a,b) sampler using R

Description Usage Arguments Value Examples

Description

A function to produce n samples of Beta(a,b)

Usage

1
gene_beta(a, b, n)

Arguments

a, b

:the param of ditribution Beta(a,b)

n

:the number of samples

Value

a random sample of size n

Examples

1
2
3
4
x=gene_beta(3,2,1000)
hist(x,prob=TRUE,main="1/beta(2,3)*x^2*(1-x)")
y=seq(0,1,0.01)
lines(y,1/beta(3,2)*y^2*(1-y))

ShiHaiyu/StatComp18099 documentation built on May 5, 2019, 11:06 p.m.