BchronDensity {Bchron} | R Documentation |
Non-parametric phase model
Description
This function runs a non-parametric phase model on 14C and non-14C ages via Gaussian Mixture density estimation
Usage
BchronDensity(
ages,
ageSds,
calCurves,
pathToCalCurves = system.file("data", package = "Bchron"),
dfs = rep(100, length(ages)),
numMix = 50,
iterations = 10000,
burn = 2000,
thin = 8,
updateAges = FALSE,
store_density = TRUE
)
Arguments
ages |
A vector of ages (most likely 14C) |
ageSds |
A vector of 1-sigma values for the ages given above |
calCurves |
A vector of values containing either |
pathToCalCurves |
File path to where the calibration curves are located. Defaults to the system directory where the 3 standard calibration curves are stored |
dfs |
Degrees-of-freedom values for the t-distribution associated with the calibration calculation. A large value indicates Gaussian distributions assumed for the 14C ages |
numMix |
The number of mixture components in the phase model. Might need to be increased if the data set is large and the phase behaviour is very complex |
iterations |
The number of iterations to run for |
burn |
The number of starting iterations to discard |
thin |
The step size of iterations to keep |
updateAges |
Whether or not to update ages as part of the MCMC run. Default is FALSE. Changing this to TRUE will improve performance but will fit a slightly invalid model |
store_density |
Whether or not to store the density and age grid. Useful for plotting the output in other packages |
Details
This model places a Gaussian mixture prior distribution on the calibrated ages and so estimates the density of the overall set of radiocarbon ages. It is designed to be a probabilistic version of the Oxcal SUM command which takes calibrated ages and sums the probability distributions with the aim of estimating activity through age as a proxy.
Value
An object of class BchronDensityRun
with the following elements:
thetaThe posterior samples of the restricted ages
pPosterior samples of the mixture proportions
muValues of the means of each Gaussian mixture
calAgesThe calibrated ages from
BchronCalibrate
GThe number of mixture components. Equal to numMix
age_gridA grid of ages used for the final density estimate
densityThe density estimate based on the above age grid
See Also
Bchronology
, BchronRSL
, BchronDensityFast
for a faster approximate version of this function
Examples
# Read in some data from Sluggan Moss
data(Sluggan)
# Run the model
SlugDens <- with(
Sluggan,
BchronDensity(
ages = ages,
ageSds = ageSds,
calCurves = calCurves
)
)
# plot it
plot(SlugDens)