MyNixOS website logo
Description

Variational Inference for Hierarchical Generalized Linear Models.

Estimates hierarchical models using mean-field variational Bayes. At present, it can estimate logistic, linear, and negative binomial models. It can accommodate models with an arbitrary number of random effects and requires no integration to estimate. It also provides the ability to improve the quality of the approximation using marginal augmentation. Goplerud (2022) <doi:10.1214/21-BA1266> provides details on the variational algorithms.

vglmer: Variational Generalized Linear Mixed Effects Regression

CRAN status R-CMD-check codecov

A package to estimate non-linear hierarchical models using the variational algorithms described in Goplerud (2022a) and in Goplerud (2022b). It also provides the option to improve an initial approximation using marginally augmented variational Bayes (MAVB) also described in Goplerud (2022a). It can be installed from CRAN or the most-to-update version can be installed using devtools.

# CRAN
install.packages("vglmer")
# Up-to-Date GitHub Version
library(devtools)
devtools::install_github("mgoplerud/vglmer", dependencies = TRUE)

At present, it can fit logistic, linear, and negative binomial outcomes with an arbitrary number of random effects. Details on negative binomial inference can be found here and are more experimental at the moment.

This package accepts "standard" glmer syntax of the form:

vglmer(formula = y ~ x + (x | g), data = data, family = 'binomial')

Splines can be estimated using v_s(x), similar to the functionality in mgcv, although with many fewer options.

vglmer(formula = y ~ v_s(x) + (x | g), data = data, family = 'binomial')

Many standard methods from lme4 work, e.g. fixef, coef, vcov, ranef, predict. Use format_vglmer to parse all parameters into a single data.frame. Estimation can be controlled via the numerous arguments to control using vglmer_control. At the moment, Schemes I, II, and III in Goplerud (2022a) correspond to strong, partial, and weak. The default is strong which correspond to the strongest (worst) approximation. If the variance of the parameters is of interest, then weak will return better results.

Please make an issue on GitHub with any concerns you have.

Metadata

Version

1.0.3

License

Unknown

Platforms (75)

    Darwin
    FreeBSD 13
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd13
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd13
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows