Skip to content

Commit

Permalink
Add glm compois
Browse files Browse the repository at this point in the history
  • Loading branch information
courtiol committed Mar 8, 2021
1 parent 5185447 commit 92552ac
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/spaMM_tidiers.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ glance.HLfit <- function(x, AIC.details = FALSE, npar.details = FALSE, ...) {
tbl_npar <- tibble::tibble(npar.fixed = x$dfs$pforpv,
npar.rand = x$dfs$p_lambda,
npar.cor = x$dfs$p_corrPars,
npar.family = ifelse(x$family$family == "negbin", 1L, 0L),
npar.family = ifelse(any(c("negbin", "COMPoisson") %in% x$family$family), 1L, 0L), ##FIXME this does not distinguish param provided vs estimated
npar.resid = x$dfs$p_fixef_phi,
npar = .data$npar.fixed + .data$npar.rand + .data$npar.cor + .data$npar.family + .data$npar.resid)

Expand Down
20 changes: 18 additions & 2 deletions vignettes/spaMM.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,15 @@ glance(glm_negbin_log_fitme, npar.details = TRUE)
## COM-Poisson GLM

### Fitting models
TO COME
```{r glm_compois, warning=FALSE}
data("freight")
glm_compois_glmmTMB <- glmmTMB(broken ~ transfers, data = freight, family = compois(link = "log"))
glm_compois_fitme <- fitme(broken ~ transfers, data = freight, family = COMPoisson(link = "loglambda"))
```

#### FIXME?

- the two packages provide quite different estimates...

### Outputs from `tidy()`
TO COME
Expand All @@ -202,7 +210,15 @@ TO COME
TO COME

### Outputs from `glance()`
TO COME
```{r glance glm_compois}
glance(glm_compois_glmmTMB)
glance(glm_compois_fitme)
```

#### FIXME?

- shall we provide sigma here?


## Zero truncated GLM

Expand Down

0 comments on commit 92552ac

Please sign in to comment.