rBP: Generate random values from a beta-Poisson model

Description Usage Arguments Value Examples

View source: R/rBP.R

Description

Generate random values from a beta-Poisson model

Usage

1
rBP(n, alp, bet, lam1 = 1, lam2 = 1, prob0 = 0)

Arguments

n

The number of random data points

alp

A non-negative value, the parameter of Beta function (alpha)

bet

A non-negative value, the parameter of Beta function (beta)

lam1

A non-negative value, the parameter for scaling

lam2

A non-negative value, the parameter for smoothing, used for BP4 or BP5

prob0

A non-negative value in [0;1), the parameter for the portion of fixed density of zero in the distribution, used for BP5

Value

A vector of the generated data points

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
set.seed(2015)
#BP3
bp.vec=rBP(100,0.2,1.5,200)
hist(bp.vec, prob=TRUE)
#BP4
bp.vec=rBP(100,0.6,1.5,20,0.05)
hist(bp.vec, prob=TRUE)
#BP5
bp.vec=rBP(100,0.2,1.5,200,0.1,0.05)
hist(bp.vec, prob=TRUE)

nghiavtr/BPSC documentation built on May 23, 2019, 4:42 p.m.