# NOT RUN {
# Data from Glendalough
data(Glendalough)
# Run in Bchronology - all but first age uses intcal20
GlenOut <- with(
Glendalough,
Bchronology(
ages = ages,
ageSds = ageSds,
calCurves = calCurves,
positions = position,
positionThicknesses = thickness,
ids = id,
predictPositions = seq(0, 1500, by = 10)
)
)
# Summarise it a few different ways
summary(GlenOut) # Default is for quantiles of ages at predictPosition values
summary(GlenOut, type = "convergence") # Check model convergence
summary(GlenOut, type = "outliers") # Look at outlier probabilities
# Predict for some new positions
predictAges <- predict(GlenOut,
newPositions = c(150, 725, 1500),
newPositionThicknesses = c(5, 0, 20)
)
# Plot the output
plot(GlenOut) +
ggplot2::labs(
title = "Glendalough",
xlab = "Age (cal years BP)",
ylab = "Depth (cm)"
)
# If you need to specify your own starting values
startingAges <- c(0, 2000, 10000, 11000, 13000, 13500)
GlenOut <- with(
Glendalough,
Bchronology(
ages = ages,
ageSds = ageSds,
calCurves = calCurves,
positions = position,
positionThicknesses = thickness,
ids = id,
predictPositions = seq(0, 1500, by = 10),
thetaStart = startingAges
)
)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab