R/negbin.sim.R

Defines functions negbin.sim

Documented in negbin.sim

negbin.sim<-function(data, mle=NULL)
{
	if(is.null(mle))
	{
		mle<-empbaysmooth(data$Observed, data$Expected)
		mle<-list(n=mle$n, size=mle$nu, 
			prob=mle$alpha/(mle$alpha+data$Expected) )
	}
	
	data$Observed<-rnbinom(n=mle$n, size=mle$size, prob=mle$prob)
	return(data)
}

Try the DCluster package in your browser

Any scripts or data that you put into this service are public.

DCluster documentation built on Sept. 3, 2023, 5:07 p.m.