Get_refmodel.brmsfit {brms} not working on zero_inflated_negbinomial

I’m trying to use projpred to analyze a brmsfit object that was fit using the zero_inflated_negbinomial() family.
Runningcv_varsel gives me an error for my zero inflated negative binomial brms model:

> fit_all_cv <- cv_varsel(fit_all ,method='forward', cv_method='LOO')
Error in get(extend_family_specific, mode = "function") : 
  object 'extend_family_zero_inflated_negbinomial' of mode 'function' was not found

Which I think is an error in the get_refmodel.brmsfit call:

refmodel <- get_refmodel(fit_all)
Error in get(extend_family_specific, mode = "function") : 
  object 'extend_family_zero_inflated_negbinomial' of mode 'function' was not found

I tried running cv_varsel on a gaussian brms model, and got no errors, so it seems to an issue specific to the zero inflated neg binomial family.

I saw some other answers about this issue that recommended updating to the current github version of brms. I did that, but am still getting the error.

Thanks for any tips!

Here’s my session info:

> sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: KDE neon User Edition 5.20

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/

 [1] LC_CTYPE=en_CA.UTF-8       LC_NUMERIC=C               LC_TIME=en_CA.UTF-8        LC_COLLATE=en_CA.UTF-8     LC_MONETARY=en_CA.UTF-8    LC_MESSAGES=en_CA.UTF-8   
 [7] LC_PAPER=en_CA.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] loo_2.4.1      projpred_2.0.2 brms_2.14.8    Rcpp_1.0.4.6  

loaded via a namespace (and not attached):
 [1] Brobdingnag_1.2-6    splines_3.6.3        gtools_3.8.2         StanHeaders_2.19.2   threejs_0.3.3        assertthat_0.2.1     shiny_1.4.0.2       
 [8] statmod_1.4.34       stats4_3.6.3         backports_1.1.6      pillar_1.4.3         lattice_0.20-41      glue_1.4.0           digest_0.6.25       
[15] checkmate_2.0.0      promises_1.1.0       minqa_1.2.4          colorspace_1.4-1     htmltools_0.5.1.1    httpuv_1.5.2         Matrix_1.2-18       
[22] plyr_1.8.6           dygraphs_1.1.1.6     pkgconfig_2.0.3      rstan_2.19.3         purrr_0.3.4          xtable_1.8-4         mvtnorm_1.1-1       
[29] scales_1.1.0         processx_3.4.2       later_1.0.0          lme4_1.1-23          tibble_3.0.1         mgcv_1.8-33          bayesplot_1.7.1     
[36] generics_0.0.2       ggplot2_3.3.0        ellipsis_0.3.0       DT_0.13              shinyjs_1.1          cli_2.0.2            magrittr_1.5        
[43] crayon_1.3.4         mime_0.9             ps_1.3.2             fansi_0.4.1          nlme_3.1-149         MASS_7.3-52          xts_0.12-0          
[50] pkgbuild_1.0.7       colourpicker_1.0     prettyunits_1.1.1    rsconnect_0.8.16     tools_3.6.3          lifecycle_0.2.0      matrixStats_0.56.0  
[57] gamm4_0.2-6          stringr_1.4.0        munsell_0.5.0        callr_3.4.3          compiler_3.6.3       rlang_0.4.8          grid_3.6.3          
[64] nloptr_1.2.2.1       ggridges_0.5.2       rstudioapi_0.11      htmlwidgets_1.5.1    crosstalk_1.1.0.1    igraph_1.2.5         miniUI_0.1.1.1      
[71] base64enc_0.1-3      boot_1.3-25          gtable_0.3.0         inline_0.3.15        abind_1.4-5          markdown_1.1         reshape2_1.4.4      
[78] R6_2.4.1             gridExtra_2.3        rstantools_2.1.1     zoo_1.8-7            bridgesampling_1.0-0 dplyr_1.0.2          fastmap_1.0.1       
[85] shinystan_2.5.0      shinythemes_1.1.2    stringi_1.5.3        parallel_3.6.3       vctrs_0.3.5          tidyselect_1.1.0     coda_0.19-3   

Hi, I’m not sure but does projpred support zi-negbin? Perhaps @AlejandroCatalina or @avehtari can clarify?


Exactly, the problem here is that we have not implemented projpred for models outside of the exponential family yet, and that includes the zero inflated negbinomial family I’m afraid.

We are working on a solution for this, so stay tuned because I think we’ll have some update sooner rather than later. I can’t say a specific time though, but hopefully before spring.


Thanks so much to the package developers! Looking forward to using the updated version.