loglik | R Documentation |
Calculates the log likelihood of a population model, given a calibrated date PD matrix
loglik(PD, model)
PD |
A data frame of Probability Distributions (PDs). Each column representing the PD of a calibrated observation or phase. Row names correspond to the calendar years BP. This data frame can be generated by |
model |
A data frame containing the columns 'pdf' representing a hypothesised population Probability Density Function; and 'year' corresponding to the calendar years BP. |
Row names of both PD and model arguments must exactly match, since the probability of each phase given the model is calculated numerically.
Returns a single numeric log likelihood.
# calibrate a dataset comprising just two phases
data <- data.frame(age=c(5800, 5100),sd=c(40, 35),phase=c('p1', 'p2'), datingType='14C')
CalArray <- makeCalArray(shcal20, calrange = range(toy$year))
PD <- phaseCalibrator(data, CalArray)
# calculate toy model log likelihood
loglik(PD, toy)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.