estimateBP: Estimate parameters of a beta-Poisson model for a data vector

Description Usage Arguments Value Examples

View source: R/estimateBP.R

Description

Estimate parameters of a beta-Poisson model for a data vector

Usage

1
2
estimateBP(x, para.num = 4, tbreak.num = 10, break.thres = 10,
  useExt = FALSE, param0 = NULL)

Arguments

x

A vector of input data points

para.num

Mode of beta-Poisson model: 3, 4 (default) or 5 parameters

tbreak.num

Number of breaks for binning

break.thres

A parameter setting of getTbreak function

useExt

A parameter setting of getTbreak function that allows to extend the last bin to infinity or not

param0

Initial parameters for the model. If it is not set, default initial parameters will be obtained from getInitParam function

Value

An optimal model to the input data including optimal parameters (par), X2 test results (X2 and PVAL), etc..

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
set.seed(2015)
#Create a simulated gene expression by randomly generating 100 data points
#from a beta-poisson model
alp=0.6;bet=1.5;lam1=20;lam2=0.05
par0=c(alp,bet,lam1,lam2)
bp.vec=rBP(100,par0)
#Estimate parameters of the four-parameter beta-Poisson model from the data points
res=estimateBP(bp.vec,para.num=4)
#Print the goodness-of-fit of the model and the optimal parameters
res$X2
res$par

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