Skip to content

Dynamics

Models predicting the changes in variant abundances over time.

Import as

from covvfit import dynamics

covvfit.dynamics.JointLogisticGrowthParams (tuple)

This is a model of logistic growth (selection dynamics) in K cities for V competing variants.

We assume that the relative growth advantages do not change between the cities, however we allow different introduction times, resulting in different offsets in the logistic growth model.

This model has V-1 relative growth rate parameters and K*(V-1) offsets.

Attrs:

relative_growths: relative growth rates, shape `(V-1,)`
relative_offsets: relative offsets, shape `(K, V-1)`

n_cities: int property readonly

Number of cities.

n_params: int property readonly

Number of all parameters in the model.

n_variants: int property readonly

Number of variants.

__getnewargs__(self) special

Return self as a plain tuple. Used by copy and pickle.

__new__(_cls, relative_growths, relative_offsets) special staticmethod

Create new instance of JointLogisticGrowthParams(relative_growths, relative_offsets)

__repr__(self) special

Return a nicely formatted representation string

from_vector(theta, n_variants) classmethod

Wraps a vector with parameters of shape (dim,) to the model. Note that dim should match the number of parameters.

predict_log_abundance(self, timepoints)

Predicts the abundances at the specified time points.

to_vector(self)

Wraps all the parameter into a single vector.

Note

This function is useful for optimization purposes, as many optimizers accept vectors, rather than tuples.