fit.zinb {semisup} | R Documentation |
This function fits the semi-supervised zero-inflated
negative binomial mixture model.
It is called by fit.wrap
.
fit.zinb(y, z, phi, pi, gamma, it.em, epsilon)
y |
observations:
numeric vector of length |
z |
class labels:
integer vector of length |
phi |
dispersion parameter:
positive numeric,
or |
pi |
zero-inflation parameter:
numeric between 0 and 1,
or |
gamma |
offset:
numeric vector of length |
it.em |
(maximum) number of iterations in the |
epsilon |
convergence criterion for the |
This function returns the parameter estimates, the posterior probabilities, and the likelihood.
This is an internal
function.
The user functions are mixtura
and scrutor
.
# data simulation n <- 100 z <- rep(0:1,each=n/2) gamma <- runif(n=n,min=0,max=2) y <- rnbinom(n=n,mu=gamma*(5+2*z),size=1/0.05) y[sample(1:n,size=0.2*n)] <- 0 z[(n/4):n] <- NA # model fitting fit.zinb(y,z,phi=0.05,pi=0.2,gamma=gamma, it.em=100,epsilon=1e-04)