R/nb.theta.R

nb.theta<-function (par, a, w, x, y, offset, beta) {
	b<- par
	if (!is.null(offset)) {
		Xb <- cbind(offset, w, x) %*% c(1, b, beta)
	} else {
		Xb <- cbind(w, x) %*% c(b, beta)
	}
	contri.LL<- y*log((a*exp(Xb))/(1+ (a*exp(Xb)))) -(1/a)*log(1+ (a*exp(Xb))) + lgamma(y+ (1/a)) - lgamma(y+1) - lgamma(1/a)
	# likelihood fxn
	loglik <- sum(contri.LL)
	-loglik
}

Try the countgmifs package in your browser

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

countgmifs documentation built on Jan. 8, 2020, 5:07 p.m.