Giter Club home page Giter Club logo

glmbayes's Introduction

glmbayes

The glmbayes package produces iid samples for Bayesian Genereralized Linear Models and is intended as a Bayesian version of the glm function for classical models.

Details

Estimation can be performed using three main functions. For models with fixed dispersion parameters, the rglmb function is the workhorse function and comes with a minimialistic interface for the input and output. It is also suitable for use as part of block Gibbs sampling procedures. The glmb function is essentially a wrapper function for the rglmb function that provides an interface closer to that of the glm function. The rglmbdisp function can be leveraged in order to produce samples for the dispersion parameters associated with the gaussian and Gamma link functions. Most methods defined for the output of the glm function are also defined for the glmb, rglmb and rglmbdisp functions (see their respective documentation for details).

For the regression parameters, multivariate normal priors are assumed. Simulation for the gaussian family with the identify link function is performed using standard procedures for multivariate normal densities. For all other families and link functions, simulation is performed using the likelihood subgradient approach of Nygren and Nygren (2006). This approach involves the construction of an enveloping function for the full posterior density followed by accept-reject sampling. For models that are approximately multivariate normal, the expected number of draws required per acceptance are bounded from above as noted in Nygren and Nygren (2006).

Currently implemented models include the gaussian (identity link), poisson/quasipoisson (log link), binomial/quasibinomial (logit, probit, and cloglog links), and Gamma (log link) families. These models all have log-concave likelihood functions that allow us to leverage the likelihood-subgradient approach for the iid sampling. Models that fail to have log-concave likelihood functions are not implemented. Our demos (viewable by entering the demo() command) provides examples of each of these families and links.

The current implementation requires separate use of the rglmbdisp function in order to generate samples for dispersion parameters (gaussian, Gammma, quasipoisson, quasibinomaial families). Our demos include examples of the joint use of the rglmb and rglmbdisp to produce samples for both regression and dispersion parameters using two-block Gibbs samplers. As these two-block Gibbs samplers likely are geometrically ergodic, future implementations may incorporate these two-block Gibbs samplers into the rglmb and glmb functions by leveraging theoretical bounds om convergence rates derived using Rosenthal (1996) type drift and minorization conditions.

The rglmb function can also be used in Block-Gibbs sampling implementations for Hierarchical Bayesian models. The demos associated with this package contains examples of such models.

glmbayes's People

Contributors

knygren avatar danieljobrien avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

glmbayes's Issues

Improve optimization inside simulation function for gamma dispersion parameter

The gamma.shape and gamma.dispersion parameters are similar to this on the classical side. Should see if source code is available for gamma.shape (or if references are available in their book) to see how they implemented the optimization. Could add an optimization step and pull out much of simulation for this in gamma case into its own function.

Add wrapper functions for f1, f2, and f3 functions

Direct users towards these "safe" wrapper functions and create a single *.Rd file to handle all the various files. Look into possibility of avoiding the need to export all the various functions from C++ (which should remove them from the manual index).

Add ability to not use Progressbar for glmb and rglmb functions

When running examples using R CMD check, examples with larger dimensions exhibit weird printing behavior because of the Progressbar (not observed in interactive mode). Would be good to be able to avoid progressbar for such examples. For now, kept examples at lower dimensions

Create function lmb and corresponding class to mirror lm

The normal-gamma regression should be able to mimic most of the feature of the lm function. This may take substantial amount of work to implement (although estimation of basic model is simple). Can also consider adding optional arguments to run with alternative prior specification over time. One of papers has implementation of iid sampling for alternate specification that works well when the prior is strong but not when prior is weak. Not sure if two-block Gibbs sampler is convergent with tight bound.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.