
poisregmixEM(y, x, lambda = NULL, beta = NULL, k = 2,
addintercept = TRUE, epsilon = 1e-08,
maxit = 10000, verb = FALSE)
addintercept
below.lambda
is
random from uniform Dirichlet and number of
components is determined by beta
.beta
parameters. Should be a pxk matrix,
where p is the number of columns of x and k is number of components.
If NULL, then beta
is generated by binning the data into k bins and using glm
lambda
and beta
are both NULL.poisregmixEM
returns a list of class mixEM
with items:logisregmixEM
## EM output for data generated from a 2-component model.
set.seed(100)
beta <- matrix(c(1, .5, .7, -.8), 2, 2)
x <- runif(50, 0, 10)
xbeta <- cbind(1, x)%*%beta
w <- rbinom(50, 1, .5)
y <- w*rpois(50, exp(xbeta[, 1]))+(1-w)*rpois(50, exp(xbeta[, 2]))
out <- poisregmixEM(y, x, verb = TRUE, epsilon = 1e-03)
out
Run the code above in your browser using DataLab