FindPredictiveCalendarAgeDensity {carbondate} | R Documentation |
Find Predictive Estimate of Shared Calendar Age Density from Bayesian Non-Parametric DPMM Output
Description
Given output from one of the Bayesian non-parametric summarisation functions (either PolyaUrnBivarDirichlet or WalkerBivarDirichlet) calculate the predictive (summarised/shared) calendar age density and probability intervals on a given calendar age grid (provided in cal yr BP).
Note: If you want to calculate and plot the result, use PlotPredictiveCalendarAgeDensity instead.
Usage
FindPredictiveCalendarAgeDensity(
output_data,
calendar_age_sequence,
n_posterior_samples = 5000,
interval_width = "2sigma",
bespoke_probability = NA,
n_burn = NA,
n_end = NA
)
Arguments
output_data |
The return value from one of the Bayesian non-parametric DPMM functions, e.g.
PolyaUrnBivarDirichlet or
WalkerBivarDirichlet, or a list, each item containing
one of these return values. Optionally, the output data can have an extra list item
named |
calendar_age_sequence |
A vector containing the calendar age grid (in cal yr BP) on which to calculate the predictive (summarised/shared) density. |
n_posterior_samples |
Number of samples it will draw, after having removed |
interval_width |
The confidence intervals to show for both the
calibration curve and the predictive density. Choose from one of |
bespoke_probability |
The probability to use for the confidence interval
if |
n_burn |
The number of MCMC iterations that should be discarded as burn-in (i.e.,
considered to be occurring before the MCMC has converged). This relates to the number
of iterations ( |
n_end |
The last iteration in the original MCMC chain to use in the calculations. Assumed to be the
total number of iterations performed, i.e. |
Value
A data frame of the calendar_age_BP
, the
density_mean
and the confidence intervals for the density
density_ci_lower
and density_ci_upper
.
See Also
PlotPredictiveCalendarAgeDensity
Examples
# NOTE: All these examples are shown with a small n_iter and n_posterior_samples
# to speed up execution.
# Try n_iter and n_posterior_samples as the function defaults.
# First generate output data
polya_urn_output <- PolyaUrnBivarDirichlet(
two_normals$c14_age,
two_normals$c14_sig,
intcal20,
n_iter = 100,
show_progress = FALSE)
# Find results for example output, 2-sigma confidence interval (default)
FindPredictiveCalendarAgeDensity(
polya_urn_output, seq(3600, 4700, length=12), n_posterior_samples = 500)