# NOT RUN {
# generate a PD array from a handful of dates
data <- subset(SAAD, site %in% c('Carrizal','Pacopampa'))
CalArray <- makeCalArray(shcal13, calrange = c(2000,6000))
PD <- phaseCalibrator(data, CalArray)
# the negative log likelihood given some random parameters for a 3-CPL model
pars <- runif(5)
objectiveFunction(pars, PD, type='CPL')
# the negative log likelihood given a random exponential model
pars <- runif(1, -0.01, 0.01)
objectiveFunction(pars, PD, type='exp')
# the negative log likelihood given a random Gaussian model
pars <- c(runif(1, 2000, 6000), runif(1, 100, 1000))
objectiveFunction(pars, PD, type='norm')
# the negative log likelihood given a uniform model
objectiveFunction(pars=NULL, PD, type='uniform')
# the negative log likelihood given a uniform model with taphonomy
pars <- c(runif(1, 0, 20000), runif(1, -3, 0))
objectiveFunction(pars=pars, PD, type='uniform', taphonomy=TRUE)
# }
Run the code above in your browser using DataLab