ConditionalPosteriorOrdinate - Conditional posterior ordinate (a.k.a. cross-validation)
| filename : | String (pass by value) |
| The name of the file where the likelhood samples are stored. | |
| columnNamesToSkip : | String[] (pass by value) |
| The names of the columns that we are going to skip. | |
| Default : [ Iteration, Posterior, Likelihood, Prior, Replicate_ID ] | |
| separator : | String (pass by value) |
| The field separator character. Values on each line of the file are separated by this character. If sep = "" the separator is 'white space', that is one or more spaces, tabs, newlines or carriage returns. |
# Create a vector of observations (e.g., site frequency spectrum)
obs_sfs = [ 305082, 44248, 32223, 28733, 28220, 26205, 27477, 26618, 27533, 26945, 28736, 28671, 31277, 31250, 34352, 34859, 38331 ]
# Read a pre-existing trace and construct the analysis object
cpo = ConditionalPosteriorOrdinate( filename="output/StairwayPlot_esfs.log" )
# Calculate the leave-one-out cross-validation probability
cpo.predictiveProbability( obs_sfs, log=FALSE )