sampleDates: Sample random calendar dates

View source: R/utilities.R

sampleDatesR Documentation

Sample random calendar dates

Description

Randomly samples calendar dates from each calibrated date or bin.

Usage

sampleDates(x, bins = NA, nsim, boot = FALSE, verbose = TRUE)

Arguments

x

A 'CalDates' class object.

bins

A vector containing the bin names associated with each radiocarbon date. If set to NA, binning is not carried out.

nsim

Number of sampling repetitions.

boot

A logical value indicating whether bootstrapping is carried out (see details below). Default is FALSE.

verbose

A logical variable indicating whether extra information on progress should be reported. Default is TRUE.

Details

The function randomly samples calendar dates based from calibrated probability distributions. When the bins argument is supplied a single calendar date is sampled from each bin. When boot=TRUE, dates (or bins) are randomly sampled with replacement before calendar dates are sampled.

Value

An object of class simdates with the following elements

  • sdates A matrix containing the randomly sampled calendar dates, with rows containing each of the nsim repetitions.

  • weight A vector (or matrix in when boot=TRUE) containing the total area under the curve of each date, normalised to sum to unity. Notice this will be identical for all dates if the calibration is carried out with the argument normalised set to TRUE.


rcarbon documentation built on Aug. 24, 2023, 5:11 p.m.