bage: Bayesian Estimation and Forecasting of Age-Specific Rates
Source:R/bage-package.R
bage-package.RdModeling of rates, probabilities, and other values, typically disaggregated by age. Estimation is done using TMB, which makes it fast and scalable.
Example workflow
Specify model using
mod_pois()Fit model using
fit()Extract results using
augment()Check model using
replicate_data()
Functions
Specify model
mod_pois()Specify a Poisson modelmod_binom()Specify a binomial modelmod_norm()Specify a normal modelset_prior()Specify prior for main effect or interactionpriors Overview of priors for main effects or interactions
set_disp()Specify prior for dispersion/varianceset_covariates()Add covariates to modeldatamods Overview of data models (measurement error models)
confidential Overview of confidentialization models
Fit model
fit()Derive posterior distribution
Extract results
augment()Original data, plus observation-level estimatescomponents() Hyper-parameters
dispersion()Dispersion parameter (a type of hyper-parameter)tidy()One-line summaryset_n_draw()Specify number of prior or posterior draws
Forecast
forecast()Use model to obtain estimates for future periods
Check model
replicate_data()Compare real and simulated datareport_sim()Simulation study of model
Author
Maintainer: John Bryant john@bayesiandemography.com
Authors:
John Bryant john@bayesiandemography.com
Junni Zhang junnizhang@163.com
Other contributors:
Bayesian Demography Limited [copyright holder]