bootstrap.MeanDate: Bootstrap Mean Ceramic Dates

bootstrap.MeanDateR Documentation

Bootstrap Mean Ceramic Dates

Description

Generates bootstrap estimations of an MCD.

Usage

## S4 method for signature 'MeanDate'
bootstrap(
  object,
  n = 1000,
  f = NULL,
  level = 0.95,
  interval = c("basic", "normal", "percentiles"),
  seed = NULL,
  calendar = get_calendar()
)

Arguments

object

A MeanDate object (typically returned by mcd()).

n

A non-negative integer specifying the number of bootstrap replications.

f

A function that takes a single numeric vector (the result of the resampling procedure) as argument.

level

A length-one numeric vector giving the confidence level. Must be a single number between 0 and 1. Only used if f is NULL.

interval

A character string giving the type of confidence interval to be returned. It must be one "basic" (the default), "normal" or "percentiles" (see arkhe::confidence_bootstrap()). Any unambiguous substring can be given. Only used if f is NULL.

seed

An object specifying if and how the random number generator should be initialized (see stats::simulate()).

calendar

An aion::TimeScale object specifying the target calendar (see aion::calendar()).

Value

If f is NULL, bootstrap() returns a data.frame with the following elements (else, returns the result of f applied to the n resampled values) :

original

The observed value.

mean

The bootstrap estimate of mean.

bias

The bootstrap estimate of bias.

error

The boostrap estimate of standard error.

lower

The lower limit of the bootstrap confidence interval at level.

upper

The upper limit of the bootstrap confidence interval at level.

Author(s)

N. Frerebeau

See Also

mcd()

Other resampling methods: bootstrap.EventDate, jackknife.EventDate, jackknife.MeanDate

Examples

## Data from Peeples and Schachner 2012
data("zuni", package = "folio")

## Set the start and end dates for each ceramic type
dates <- list(
  LINO = c(600, 875), KIAT = c(850, 950), RED = c(900, 1050),
  GALL = c(1025, 1125), ESC = c(1050, 1150), PUBW = c(1050, 1150),
  RES = c(1000, 1200), TULA = c(1175, 1300), PINE = c(1275, 1350),
  PUBR = c(1000, 1200), WING = c(1100, 1200), WIPO = c(1125, 1225),
  SJ = c(1200, 1300), LSJ = c(1250, 1300), SPR = c(1250, 1300),
  PINER = c(1275, 1325), HESH = c(1275, 1450), KWAK = c(1275, 1450)
)

## Calculate date midpoints
mid <- vapply(X = dates, FUN = mean, FUN.VALUE = numeric(1))

## Calculate MCD
(mc_dates <- mcd(zuni[100:125, ], dates = mid))

## Get MCD in years CE
time(mc_dates, calendar = CE())

## Bootstrap resampling
boot <- bootstrap(mc_dates, n = 30)
head(boot)

## Jackknife resampling
jack <- jackknife(mc_dates)
head(jack)

## Plot
plot(mc_dates, decreasing = FALSE)
## Add bootstrap confidence intervals
segments(x0 = boot$lower, y0 = seq_len(nrow(boot)),
         x1 = boot$upper, y1 = seq_len(nrow(boot)))

tesselle/kairos documentation built on June 1, 2025, 9:03 p.m.