R/run.bchron.LiPD.R
runBchron.RdThis is a high-level function that uses Bchron to simulate an age model, and stores this as an age-ensemble in a model in chronData. If needed input variables are not entered, and cannot be deduced, it will run in interactive mode. See Haslett and Parnell (2008) doi:10.1111/j.1467-9876.2008.00623.x for details.
runBchron(
L,
chron.num = NA,
meas.table.num = NA,
site.name = L$dataSetName,
model.num = NA,
cal.curves = NA,
iter = 10000,
outlier.probs = 0.05,
ask = TRUE,
lab.id.var = "labID",
age.14c.var = "age14C",
age.14c.uncertainty.var = "age14CUnc",
age.var = "age",
age.uncertainty.var = "ageUnc",
depth.var = "depth",
reservoir.age.14c.var = "reservoirAge",
reservoir.age.14c.uncertainty.var = "reservoirAge14C",
rejected.ages.var = "rejected",
depth.units = "cm",
which.table = NA,
...
)A LiPD object - an R serialization of a single LiPD file. It's a list, and is typically created by `readLipd()`
the number of the chronData object that you'll be working in
an integer that corresponds to paleo.num measurementTable has the variable you want?
the name of the site
chron.numModel do you want to use?
The calibration curves to be used. Enter either "marine20", intcal20", "shcal20" or "normal". Will prompt if not provided.
number of iterations to use in bchron (default = 10000)
probability of outliers amongst the dates
ask for user input? (True/False)
Lab Id variable name
Radiocarbon age variable name
Radiocarbon age uncertainty variable name
Calibrated age variable name
Calibrated age uncertainty variable name
Depth variable name
Reservoir age variable name
Reservoir age uncertainty variable name
Rejected ages variable name
units for depth
deprecated. Use meas.table.num instead.
Arguments passed on to Bchron::Bchronology
agesA vector of ages provided in years before 1950.
ageSdsA vector of 1-sigma values for the ages given above
positionsPosition values (e.g. depths) for each age. In the case of layers of non-zero thickness, this should be the middle value of the slice
positionThicknessesThickness values for each of the positions. The thickness value should be the full thickness value of the slice. By default set to zero.
calCurvesA vector of values containing either intcal20, shcal20, marine20, or normal (older calibration curves are supposed such as intcal13). Should be the same length the number of ages supplied. Non-standard calibration curves can be used provided they are supplied in the same format as those previously mentioned and are placed in the same directory. Normal indicates a normally-distributed (non-14C) age.
idsID names for each age
outlierProbsA vector of prior outlier probabilities, one for each age. Defaults to 0.01
predictPositionsA vector of positions (e.g. depths) at which predicted age values are required. Defaults to a sequence of length 100 from the top position to the bottom position
pathToCalCurvesFile path to where the calibration curves are located. Defaults to the system directory where the 3 standard calibration curves are stored.
artificialThicknessAmount to add to the thickness values in the case of equal positions with no positionThicknesses. Bchron may fail if positionThicknesses are zero and some positions are repeated. This value is added on to the zero thicknesses (only in the case of repeated positions) to stop this failure.
allowOutsideWhether to allow calibrations to run outside the range of the calibration curve. By default this is turned off as calibrations outside of the range of the calibration curve can cause severe issues with probability ranges of calibrated dates
iterationsThe number of iterations to run the procedure for
burnThe number of starting iterations to discard
thinThe step size for every iteration to keep beyond the burn-in
extractDateThe top age of the core. Used for extrapolation purposes so that no extrapolated ages go beyond the top age of the core. Defaults to the current year
maxExtrapThe maximum number of extrapolations to perform before giving up and setting the predicted ages to NA. Useful for when large amounts of extrapolation are required, i.e. some of the predictPositions are a long way from the dated positions
thetaStartA set of starting values for the calendar ages estimated by Bchron. If NULL uses a function to estimate the ages. These should be in the same units as the posterior ages required. See example below for usage.
thetaMhSdThe Metropolis-Hastings standard deviation for the age parameters
muMhSdThe Metropolis-Hastings standard deviation for the Compound Poisson-Gamma mean
psiMhSdThe Metropolis-Hastings standard deviation for the Compound Poisson-Gamma scale
ageScaleValA scale value for the ages. Bchronology works best when the ages are scaled to be approximately between 0 and 100. The default value is thus 1000 for ages given in years.
positionEpsA small value used to check whether simulated positions are far enough apart to avoid numerical underflow errors. If errors occur in model runs (e.g. missing value where TRUE/FALSE needed increase this value)
positionNormaliseWhether to normalise the position values. Bchronology works best when the positions are normalised to be between 0 and 1 The default value is TRUE
L. The single LiPD object that was entered, with methods, ensembleTable, summaryTable and distributionTable added to the chronData model.
if (FALSE) { # \dontrun{
#Run in interactive mode:
L = runBchron(L)
#Run in noninteractive mode:
L = runBchron(L,
chron.num = 1,
site.name = "MyWonderfulSite",
model.num = 3,
cal.curves = "marine20")
} # }