tracts.demography.composite_demographic_model

Classes

CompositeDemographicModel(model_function, ...)

The class of demographic models that account for variance in the number of ancestors of individuals of the underlying population.

class tracts.demography.composite_demographic_model.CompositeDemographicModel(model_function, parameters, proportions_list)

Bases: object

The class of demographic models that account for variance in the number of ancestors of individuals of the underlying population.

Specifically, this is the demographic model constructed by the “multifracs” family of optimization routines.

The expected tract counts per bin in the composite demographic model is simply a component-wise sum of the expected tract counts per bin across the component demographic models.

The log-likelihood of the composite demographic model is the computed based on the combined expected tract counts per bin.

__init__(model_function, parameters, proportions_list)

Constructs a composite demographic model, in which we consider split groups of individuals.

Parameters:
  • (callable) (model_function) – A function that produces a migration matrix given some model parameters and fixed ancestry proportions.

  • parameters – The parameters given to the model function when the component demographic models are built.

  • proportions_list – The lists of ancestry proportions used to construc each component demographic model.

expectperbin(Ls, pop, bins, nsamp_list=None)

A wrapper for demographic_model.expectperbin that yields a component-wise sum of the counts per bin in the underlying demographic models. Since the counts given by demographic_model.expectperbin are normalized, performing a simple sum of the counts is not particularly meaningful; it throws away some of the structure that we have gained by using a composite model. Hence, the nsamp_list parameter allows for specifying the count of individuals in each of the groups represented by this composite_demographic_model, which is then used to rescale the counts reported by the expectperbin of the component demographic models.

loglik(bins, Ls, data_list, nsamp_list, cutoff=0)

Evaluates the log-likelihood of the composite demographic model.

To compute the log-likelihood, we combine the expected count of tracts per bin in each of the component demographic models into the composite expected counts per bin. The expected counts per bin are compared with the sum across subgroups of the actual counts per likelihoods of the component demographic models.

See demographic_model.loglik for more information about the specifics of the log-likelihood calculation.

migs()

Get the list of migration matrices of the component demographic models. This method merely projects the mig attribute from the component models.