GithubHelp home page GithubHelp logo

arh926 / sptwdglm Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 160 KB

R-package for performing Bayesian Variable Selection in Double Generalized Linear Tweedie Spatial Process Models

Home Page: https://doi.org/10.51387/23-NEJSDS37

License: Other

R 100.00%
bayesian double-generalized-linear-models tweedie-distribution spatial-process-models spike-slab-priors

sptwdglm's Introduction

sptwdglm: An R-package for performing Bayesian Variable selection using Spike and Slab priors for Double Generalized Linear Tweedie Spatial Process Models

Maintainer

sptwdglm contains MCMC algorithms for fitting the following models:

Function Models
dglm.autograd.R Double Generalzied Linear Model (DGLM)
ssdglm.autograd.R Spike and Slab Priors for DGLMs
spdglm.autograd.R Spatial DGLMs
spssdglm.autograd.R Spike and Slab Priors for Spatial DGLMs

Variable selection is performed using the function FDR.R on the model coefficients.

It supplements the paper titled, "Bayesian Variable Selection in Double Generalized Linear Tweedie Spatial Process Models", New England Journal of Statistics in Data Science: Special Issue on Modern Bayesian Methods with Applications in Data Science (https://doi.org/10.51387/23-NEJSDS37).

All of the above MCMC samplers use a Metropolis Adjusted Langevin Algorithm (MALA, see Girolami and Calderhead, 2011 https://rss.onlinelibrary.wiley.com/doi/10.1111/j.1467-9868.2010.00765.x).

Figure showing spatial patterns on the left column and logarithm of aggregated Tweedie response on the right column for 10,000 realizations across 100 locations.

Installation

You can install the development version of sptwdglm like so:

# if you dont have devtools installed
# install.packages("devtools")
devtools::install_github("arh926/sptwdglm")

Example

There are examples contained within every function. Please install the package to view them.

require(sptwdglm)

# non-spatial
mc <- Function(response, mean covariates, dispersion covariates, mcmc parameters)
# spatial
mc <- Function(coordinates, response, mean covariates, dispersion covariates, mcmc parameters)

# Diagnostics
plot_mcmc(posterior samples)

# Variable selection through FDR for coefficients
FDR(mean coefficients)
FDR(dispersion coefficients)

sptwdglm's People

Contributors

arh926 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.