# NOT RUN {
# randomly sample calendar dates from the toy model
set.seed(12345)
N <- 350
cal <- simulateCalendarDates(toy, N)
# Convert to 14C dates.
age <- uncalibrateCalendarDates(cal, shcal20)
data <- data.frame(age = age, sd = 50, phase = 1:N, datingType = '14C')
# }
# NOT RUN {
# Calibrate each phase, taking care to restrict to the modelled date range
CalArray <- makeCalArray(shcal20, calrange = range(toy$year), inc = 5)
PD <- phaseCalibrator(data, CalArray, remove.external = TRUE)
# Run MCMC for a 3-CPL model (5 parameters)
chain <- mcmc(PDarray = PD,
startPars = rep(0.5,5),
type='CPL',
jumps = 0.02)
# Run MCMC for a 3-CPL model with taphonomy (5 + 2 parameters)
chain <- mcmc(PDarray = PD,
startPars = c(rep(0.5,5),10000,-1.5),
type='CPL',
taphonomy=TRUE,
jumps = 0.02)
# }
Run the code above in your browser using DataLab