posterior_predict function

Posterior predictive samples from models fit by bayesGAM

Posterior predictive samples from models fit by bayesGAM

Draw from the posterior predictive distribution

posterior_predict(object, ...) ## S4 method for signature 'bayesGAMfit' posterior_predict(object, draws = NULL, ...) ## S4 method for signature 'glmModel' posterior_predict(object, draws = NULL, results = NULL, ...)

Arguments

  • object: Object of type bayesGAMfit generated from bayesGAM.
  • ...: Additional arguments for postrior_predict
  • draws: An integer indicating the number of draws to return. The default and maximum number of draws is the size of the posterior sample.
  • results: Matrix of HMC posterior samples

Returns

a list of D by N matrices, where D is the number of draws from the posterior predictive distribution and N is the number of data points being predicted per draw.

Examples

f <- bayesGAM(weight ~ np(height), data = women, family = gaussian, iter=1000, chains = 1) res <- posterior_predict(f, draws=100)

References

Goodrich B, Gabry J, Ali I & Brilleman S. (2020). rstanarm: Bayesian applied regression modeling via Stan. R package version 2.19.3 https://mc-stan.org/rstanarm.

Jonah Gabry, Ben Goodrich and Martin Lysy (2020). rstantools: Tools for Developing R Packages Interfacing with 'Stan'. https://mc-stan.org/rstantools/, https://discourse.mc-stan.org/.

  • Maintainer: Samuel Thomas
  • License: GPL-3
  • Last published: 2022-03-17

Useful links