pram.model package

Submodules

pram.model.epi module

Contains epidemiological models code.

class pram.model.epi.SEI2RModelParams(beta, kappa_1, kappa_2, gamma, r0=None)

Bases: pram.model.epi.ModelParams

classmethod by_clinical_obs(s0, r0, incub_period, asympt_period, inf_dur)

Instantiates the class using clinical observations instead of model rate parameters. This is useful because typically the former are easier to obtain and more agreed upon.

The actual number of arguments to the method of an extending class will depend on the number of compartments in in the underlying model. Progression rates (kappa) should be computed based on incubation and symptomatic periods (inbub_period and sympt_period). Recovery rates (gamma) should be computed based on infection durations (inf_dur). Finally, transmission rates (beta) should be based on the R0 formula, which for the SIR model (and all descendant models without vital dynamics) takes the form:

R0 = beta * S0 / gamma, where S0 is the initial size of the susceptible population

class pram.model.epi.SEIRModel(var, beta, kappa, gamma, name='seir-model', t=attr.attrs, i=attr.attrs, solver=<pram.model.model.MCSolver object>, memo=None, cb_before_apply=None)

Bases: pram.model.model.Model

SEIR model interface.

class pram.model.epi.SEIRModelParams(beta, kappa, gamma, r0=None)

Bases: pram.model.epi.ModelParams

classmethod by_clinical_obs(s0, r0, incub_period, sympt_period)

Instantiates the class using clinical observations instead of model rate parameters. This is useful because typically the former are easier to obtain and more agreed upon.

The actual number of arguments to the method of an extending class will depend on the number of compartments in in the underlying model. Progression rates (kappa) should be computed based on incubation and symptomatic periods (inbub_period and sympt_period). Recovery rates (gamma) should be computed based on infection durations (inf_dur). Finally, transmission rates (beta) should be based on the R0 formula, which for the SIR model (and all descendant models without vital dynamics) takes the form:

R0 = beta * S0 / gamma, where S0 is the initial size of the susceptible population

class pram.model.epi.SEQIHRModel(var, beta, alpha_n, alpha_q, delta_n, delta_h, mu, chi, phi, rho, name='seqihr-model', t=attr.attrs, i=attr.attrs, solver=<pram.model.model.MCSolver object>, memo=None)

Bases: pram.model.model.Model

SEQIHR model interface.

class pram.model.epi.SIRModel(var, beta, gamma, name='sir-model', t=attr.attrs, i=attr.attrs, solver=<pram.model.model.MCSolver object>, memo=None)

Bases: pram.model.model.Model

class pram.model.epi.SIRSModel(var, beta, gamma, alpha=0.0, name='sirs-model', t=attr.attrs, i=attr.attrs, solver=<pram.model.model.MCSolver object>, memo=None)

Bases: pram.model.model.Model

SIRS model interface.

Notes

alpha = 0 implies the SIR model.

class pram.model.epi.SISModel(rule)

Bases: pram.model.model.Model

pram.model.model module

Contains abstract and generic model code.

class pram.model.model.MCSolver

Bases: pram.model.model.Solver

Markov chain model solver.

class pram.model.model.Model(rule)

Bases: abc.ABC

A model base class.

Parameters

rule (Rule) – The group rule implementing the model dynamics.

set_params(**kwargs)
exception pram.model.model.ModelConstructionError

Bases: Exception

class pram.model.model.ODESolver(dt=0.1)

Bases: pram.model.model.Solver

Ordinary differential equations system model solver.

Parameters

dt (float) – Numeric integrator time step size.

class pram.model.model.Solver

Bases: abc.ABC

Model solver base class.

Module contents