Skip to content
Snippets Groups Projects
Commit a6911f8f authored by Eduardo E. R. Junior's avatar Eduardo E. R. Junior
Browse files

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

parent 0d906142
No related branches found
No related tags found
No related merge requests found
...@@ -191,6 +191,22 @@ predict.mle2 <- function(object, newdata, ...@@ -191,6 +191,22 @@ predict.mle2 <- function(object, newdata,
MARGIN = 2, MARGIN = 2,
FUN = calc_mean_gcnt, FUN = calc_mean_gcnt,
alpha = exp(coef(object)[1]))}) 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) pred <- cbind(pred)
colnames(pred) <- names(qn) colnames(pred) <- names(qn)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment