# GAMM with Zero-Inflated Negative Binomial - Looking for a package on R

I am looking for an R package to fit Generalized Additive Mixed Models with ZINB distribution, as ZINB is not available in the mgcv package nor in the gamm4 package. I read here that it might be possible with the brms package but I have never worked in a Bayesian framework. Do you know any other frequentist package that would allow fitting GAMM with ZINB?

This model is possible with the brms R package which is an interface to R:

A slight modification of one of the examples from https://cran.r-project.org/web/packages/brms/vignettes/brms_distreg.html shows essentially what is involved in setting up and fitting the model

## load package
library('brms')

## fit a model with constant zero inflation
fit_zinb1 <- brm(count ~ s(persons, k = 4) + s(child, k = 4) + camper,
data = zinb, family = zero_inflated_negbinomial(),
chains = 4, cores = 4,
## plot the marginal effects
plot(marginal_effects(fit_zinb1))
## model summary
summary(fit_zinb1, WAIC = FALSE)

## fit a model where the zero-inflation is a constant plus a linear
##   effect of number of children
fit_zinb2 <- brm(bf(count ~ s(persons, k = 4) + s(child, k= 4) + camper,
zi ~ s(child, k = 4)),
data = zinb, family = zero_inflated_negbinomial(),
chains = 4, cores = 4,