Base Class for Summary Statistics
Base Class for Summary Statistics
coala::coalmodelpart
-> sumstat
new()
Initialization of $sumstat
sumstat_class$new(name, transformation)
name
the name to be used for this statistic
transformation
transformation to be used for this statistic
NULL
calculate()
This function must be overwritten in the derived class
sumstat_class$calculate(seg_sites, trees, files, model)
seg_sites
seg_sites object containing the segregating sites
trees
trees
files
files
model
demographic model
NULL
check()
Optional functions that checks if a model is compatible with the stat.
In a derived class this can be overwritten by a function that throws an informative error if the model is incompatible with the statistic The function is executed before the statistic is added to the model.
sumstat_class$check(model)
model
demographic model
invisible TRUE
get_name()
function to read the private attribute name
sumstat_class$get_name()
name of the statistic
requires_files()
function to check whether files are required by this statsitic
sumstat_class$requires_files()
req_files, which is TRUE or FALSE and indicates whether files are required by this statsitic
requires_segsites()
function to check whether segregating sites are required by this statsitic
sumstat_class$requires_segsites()
req_segsites, which is TRUE or FALSE and indicates whether segregating sites are required by this statsiti
requires_trees()
function to check whether trees are required by this statsitic
sumstat_class$requires_trees()
req_trees, which is TRUE or FALSE and indicates whether trees are required by this statsitic
x
untransformed value
transformed value
clone()
The objects of this class are cloneable with this method.
sumstat_class$clone(deep = FALSE)
deep
Whether to make a deep clone.
If you want to create additional summary statistics for coala, create R6 classes that inherit from this object.