bayes.boot: Bayesian bootstrap

bayes.bootR Documentation

Bayesian bootstrap

Description

Performs a Bayesian bootstrap for a statistic defined via a suitable function.

Usage

bayes.boot(x, fun, nboot = 1000, cluster = NULL, ...)

Arguments

x

a numeric vector to be passed as the first argument to fun

fun

the function to bootstrap; must accept data x and weights w (in that order), and return a data frame

nboot

the number of bootstraps to perform

cluster

an optional cluster for running bootstraps in parallel; must be set up using parallel::makeCluster

...

any other arguments for fun

Value

An object of class bayes.boot; a data frame with the following columns:

boot.id

the bootstrap iteration index

...

any columns returned by fun

Author(s)

Ryan Thompson <ryan.thompson1@unsw.edu.au>

Examples

set.seed(123)

boot <- bayes.boot(MASS::galaxies, fun = fit.family, nboot = 100)
head(boot)

familial documentation built on July 9, 2023, 7:27 p.m.