Commit a6911f8f authored by Eduardo E. R. Junior's avatar Eduardo E. R. Junior

Adiciona método de predição para modelos COM-Poisson

parent 0d906142
......@@ -191,6 +191,22 @@ predict.mle2 <- function(object, newdata,
MARGIN = 2,
FUN = calc_mean_gcnt,
alpha = exp(coef(object)[1]))})
},
"llcmp" = {
V <- vcov(object)
Vc <- V[-1, -1] - V[-1, 1] %*%
solve(V[1, 1]) %*% V[1, -1]
eta <- cholV_eta(Vc, X,
b = coef(object)[-1],
qn = qn)
switch(type,
"link" = eta,
"response" = {
apply(exp(as.matrix(eta)),
MARGIN = 2,
FUN = calc_mean_cmp,
nu = exp(coef(object)[1]),
sumto = object@data$sumto)})
})
pred <- cbind(pred)
colnames(pred) <- names(qn)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment