estimateBPMatrix: Estimate parameters of beta-Poisson models for a data matrix

Description Usage Arguments Value Examples

View source: R/estimateBPMatrix.R

Description

Estimate parameters of beta-Poisson models for a data matrix

Usage

1
2
3
estimateBPMatrix(dataMat, para.num = 4, tbreak.num = 10, fout = NULL,
  break.thres = 10, estIntPar = TRUE, extreme.quant = NULL,
  useExt = FALSE, min.exp = 1e-04, useParallel = FALSE)

Arguments

dataMat

Data matrix that needs to be modelled

para.num

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

tbreak.num

Number of breaks for binning

fout

A *.RData file name to export results

break.thres

A parameter setting of getTbreak function

estIntPar

An option to allow estimating initial parameters for the model from only expressed values

extreme.quant

A quantile probability to remove extrem values (outliers) higher than the quantile. If extreme.quant=NULL, no elimination of outliers is done

useExt

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

min.exp

A threshold for minimum expressed values. If a expression is less than min.exp, it is set to be zero

useParallel

An option to allow using parallel computing

Value

A list of optimal models corresponding to the rows of the matrix. Each model consists of optimal parameters, X2 test results (X2 and PVAL), etc..

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
set.seed(2015)
#create random data matrix from a beta-poisson model
N=10
alp=sample(100,N,replace=TRUE)*0.1;
bet=sample(100,N,replace=TRUE)*0.1;
lam1=sample(100,N,replace=TRUE)*10;
lam2=sample(100,N,replace=TRUE)*0.01;
n=100
bp.mat=NULL
for (i in 1:N)
  bp.mat=rbind(bp.mat,rBP(n,alp=alp[i],bet=bet[i],lam1=lam1[i],lam2=lam2[i]))
#Estimate parameters from the data set
mat.res=estimateBPMatrix(bp.mat,para.num=4,fout=NULL,estIntPar=FALSE,useParallel=FALSE)
#In this function, user can also set estIntPar=TRUE to have better estimated beta-Poisson
#models for the generalized linear model. However, a longer computational time is required.

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