MyNixOS website logo
Description

Additive Regression for Discrete Data.

Methods for fitting identity-link GLMs and GAMs to discrete data, using EM-type algorithms with more stable convergence properties than standard methods.

addreg

CRAN_Status_Badge

addreg provides methods for fitting identity-link GLMs and GAMs to discrete data, using EM-type algorithms with more stable convergence properties than standard methods.

An example of periodic non-convergence using glm (run with trace = TRUE to see deviance at each iteration):

require(glm2, quietly = TRUE)
data(crabs)

crabs.boot <- crabs[crabs$Rep1, -c(5:6)]

t.glm <- system.time(
  fit.glm <- glm(Satellites ~ Width + Dark + GoodSpine, data = crabs.boot, family = poisson(identity),
                    start = rep(1, 4), maxit = 500)
)

The combinatorial EM method (Marschner, 2010) provides stable convergence:

require(addreg, quietly = TRUE)
t.cem <- system.time(
  fit.cem <- addreg(Satellites ~ Width + Dark + GoodSpine, data = crabs.boot, family = poisson,
                    start = rep(1, 4))
)

...but it can take a while. Using an overparameterised EM approach removes the need to run (2^3 = 8) separate EM algorithms:

t.em <- system.time(fit.em <- update(fit.cem, method = "em"))

while generic EM acceleration algorithms from the turboEM package --- implemented in version (\geq) 3.0 --- can speed this up further still:

t.cem.acc <- system.time(fit.cem.acc <- update(fit.cem, accelerate = "squarem"))
t.em.acc <- system.time(fit.em.acc <- update(fit.em, accelerate = "squarem"))

Comparison of results:

#>         converged    logLik iterations time
#> glm         FALSE -518.2579        500 0.06
#> cem          TRUE -500.8886       6101 0.69
#> em           TRUE -500.8886       1680 0.13
#> cem.acc      TRUE -500.8886        128 0.11
#> em.acc       TRUE -500.8886         38 0.05

The combinatorial EM algorithms for identity-link binomial (Donoghoe and Marschner, 2014) and negative binomial (Donoghoe and Marschner, 2016) models are also available, using family = binomial and family = negbin1, respectively.

Semi-parametric regression using B-splines (Donoghoe and Marschner, 2015) can be incorporated by using the addreg.smooth function. See example(addreg.smooth) for a simple example.

Installation

Get the released version from CRAN:

install.packages("addreg")

Or the development version from github:

# install.packages("devtools")
devtools::install_github("mdonoghoe/addreg")

References

  • Donoghoe, M. W. and I. C. Marschner (2014). Stable computational methods for additive binomial models with application to adjusted risk differences. Computational Statistics and Data Analysis80: 184-196.
  • Donoghoe, M. W. and I. C. Marschner (2015). Flexible regression models for rate differences, risk differences and relative risks. International Journal of Biostatistics11(1): 91-108.
  • Donoghoe, M. W. and I. C. Marschner (2016). Estimation of adjusted rate differences using additive negative binomial regression. Statistics in Medicine35(18): 3166-3178.
  • Marschner, I. C. (2010). Stable computation of maximum likelihood estimates in identity link Poisson regression. Journal of Computational and Graphical Statistics19(3): 666-683.
Metadata

Version

3.0

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