regionSegAlphaNB: Estimate matrix of dispersion parameter alpha (size) used in...

Description Usage Arguments Details Value References See Also Examples

View source: R/biomvRseg.R

Description

Estimate matrix of dispersion parameter alpha (size) used in regionSegCost for negative binomial distributed x.

Usage

1
regionSegAlphaNB(x, maxk = NULL, segs = NULL, useMC = FALSE, tol=1e-06)

Arguments

x

The input data matrix or vector

maxk

Maximum number of index to search forward

segs

Starting indices (excluding 1) for the candidate segments, for the second stage model, maxk will be overridden with length(segs)+1.

useMC

TRUE if mclapply should be used to speed up the calculation

tol

tolerance level for the convergence criteria in the maximum likelihood estimation of negative binomial distribution dispersion parameter.

Details

Estimate matrix of dispersion parameter alpha (size) used in regionSegCost for negative binomial distributed x.

Value

Matrix with maxk rows and nrow(x) columns, or a length(segs)+1 square matrix for the second stage model.

References

Piegorsch, W. W. (1990). Maximum likelihood estimation for the negative binomial dispersion parameter. Biometrics, 863-867.

Robinson MD and Smyth GK (2008). Small-sample estimation of negative binomial dispersion, with applications to SAGE data. Biostatistics, 9, 321-332

See Also

regionSegCost

Examples

1
2
3
4
5
	x<-matrix(rnbinom(120, size=0.05, mu=20), ncol=3)
	Aa<-regionSegAlphaNB(x, maxk=20)
	dim(Aa) # [1] 20 40
	Ab<-regionSegAlphaNB(x, segs=as.integer(c(3, 6, 12, 30)))
	dim(Ab) # [1] 5 5

biomvRCNS documentation built on Nov. 8, 2020, 6:49 p.m.