Learn R Programming

bayesGAM

Bayesian generalized additive models using Stan

The bayesGAM package is designed to provide a user friendly option to fit univariate and multivariate response Generalized Additive Models (GAM) using Hamiltonian Monte Carlo (HMC) with few technical burdens. The R functions in this package use rstan (Stan Development Team 2020) to call Stan routines that run the HMC simulations. The Stan code for these models is already translated to C++ and pre-compiled for the user. The programming formulation for models in bayesGAM is designed to be familiar to statisticians and analysts who fit statistical models in R.

Copy Link

Version

Install

install.packages('bayesGAM')

Monthly Downloads

88

Version

0.0.2

License

GPL-3

Maintainer

Samuel Thomas

Last Published

March 17th, 2022

Functions in bayesGAM (0.0.2)

getDesign

Design matrices from a bayesGAMfit object
bayesGAMfit-class

Contains results from rstan as well as the design matrices and other data for the model.
loo_compare_bgam

Calls the loo package to compare models fit by bayesGAMfit
mcmc_plots

Plotting for MCMC visualization and diagnostics provided by bayesplot package
getStanResults

Returns the stanfit object generated by rstan
loo_bgam

Calls the loo package to perform efficient approximate leave-one-out cross-validation on models fit with bayesGAM
extract_log_lik_bgam

Extract the log likelihood from models fit by bayesGAM
plot

Additional plotting for MCMC visualization and diagnostics.
reef

Coral reef data from survey data on 6 sites
np

Creates design matrices for univariate and bivariate applications
predict

Posterior predictive samples from models fit by bayesGAM, but with new data
posterior_predict

Posterior predictive samples from models fit by bayesGAM
mvcorrplot

Multivariate response correlation plot for bayesGAMfit objects
normal

Constructor function for Normal priors
getModelSlots

Return one or slots from the Stan model in bayesGAM
ppc_plots

Plotting for MCMC visualization and diagnostics provided by bayesplot package
waic_bgam

Calls the loo package to calculate the widely applicable information criterion (WAIC)
summary

Summarizing Model Fits from bayesGAM
st

Constructor function for Student-t priors
getSamples

Extract the MCMC samples from an object of type bayesGAMfit
showPrior

Display the priors used in bayesGAM
create_bivariate_design

Creates a design matrix from a bivariate smoothing algorithm
L

Lag function for autoregressive models
bayesGAM-package

The 'bayesGAM' package.
bayesGAM

bayesGAM fits a variety of regression models using Hamiltonian Monte Carlo
fitted

Extract fitted values from a model fit by bayesGAM
bloodpressure

Blood pressure data from a clinical study
coefficients

Extract Model Coefficients