View source: R/cal_aggregate.R
cal_density | R Documentation |
Aggregates calibrated radiocarbon dates and other calendar probability distributions using the composite kernel density estimate (cKDE) method method \insertCiteBrown2017c14. This involves estimating the density of a set of dates by repeatedly computing the kernel density estimate of a random sample of ages drawn from their probability distributions.
cal_density(x, bw = 30, ..., times = 25, bootstrap = TRUE, strata = NULL)
## S3 method for class 'c14_cal'
density(x, ...)
x |
A cal vector of calendar probability distributions |
bw |
Kernel bandwidth size passed to |
... |
Further arguments passed to |
times |
Number of bootstrap samples to generate. The default of |
bootstrap |
If |
strata |
If not |
cal_density(..., bootstrap = TRUE)
performs composite kernel density
estimation with bootstrapping \insertCiteMcLaughlin2019c14, where
sampling error. x
is estimated by randomly resampling x
before each KDE
calculation.
See \insertCiteMcLaughlin2019;textualc14 and \insertCiteCrema2022;textualc14 for discussions of bandwith selection.
The result as a data frame or tibble::tibble with three columns: age
(interpolated to common range of x
), .estimate
(mean of the bootstrapped
KDEs), and .error
(standard error of the bootstrapped KDEs).
Other functions for aggregating calendar probability distributions:
cal_sum()
data(shub1_c14)
shub1_cal <- c14_calibrate(shub1_c14$c14_age, shub1_c14$c14_error)
cal_density(shub1_cal)
# Stratify and weight bootstrap estimation by phase
cal_density(shub1_cal, strata = shub1_c14$phase)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.