parameters

parameters

Set the parameters for Covasim.

Functions

Name Description
get_cross_immunity Get the cross immunity between each variant in a sim
get_prognoses Return the default parameter values for prognoses
get_vaccine_choices Define valid pre-defined vaccine names
get_vaccine_dose_pars Define the parameters for each vaccine
get_vaccine_variant_pars Define the effectiveness of each vaccine against each variant
get_variant_choices Define valid pre-defined variant names
get_variant_pars Define the default parameters for the different variants
make_pars Create the parameters for the simulation. Typically, this function is used
reset_layer_pars Helper function to set layer-specific parameters. If layer keys are not provided,

get_cross_immunity

parameters.get_cross_immunity(default=False, variant=None)

Get the cross immunity between each variant in a sim

get_prognoses

parameters.get_prognoses(by_age=True, version=None)

Return the default parameter values for prognoses

The prognosis probabilities are conditional given the previous disease state.

Parameters

Name Type Description Default
by_age bool whether to use age-specific values (default true) True

Returns

Name Type Description
prog_pars dict the dictionary of prognosis probabilities

get_vaccine_choices

parameters.get_vaccine_choices()

Define valid pre-defined vaccine names

get_vaccine_dose_pars

parameters.get_vaccine_dose_pars(default=False, vaccine=None)

Define the parameters for each vaccine

get_vaccine_variant_pars

parameters.get_vaccine_variant_pars(default=False, vaccine=None)

Define the effectiveness of each vaccine against each variant

get_variant_choices

parameters.get_variant_choices()

Define valid pre-defined variant names

get_variant_pars

parameters.get_variant_pars(default=False, variant=None)

Define the default parameters for the different variants

make_pars

parameters.make_pars(
    set_prognoses=False,
    prog_by_age=True,
    version=None,
    **kwargs,
)

Create the parameters for the simulation. Typically, this function is used internally rather than called by the user; e.g. typical use would be to do sim = cv.Sim() and then inspect sim.pars, rather than calling this function directly.

Parameters

Name Type Description Default
set_prognoses bool whether or not to create prognoses (else, added when the population is created) False
prog_by_age bool whether or not to use age-based severity, mortality etc. True
kwargs dict any additional kwargs are interpreted as parameter names {}
version str if supplied, use parameters from this Covasim version None

Returns

Name Type Description
pars dict the parameters of the simulation

reset_layer_pars

parameters.reset_layer_pars(pars, layer_keys=None, force=False)

Helper function to set layer-specific parameters. If layer keys are not provided, then set them based on the population type. This function is not usually called directly by the user, although it can sometimes be used to fix layer key mismatches (i.e. if the contact layers in the population do not match the parameters). More commonly, however, mismatches need to be fixed explicitly.

Parameters

Name Type Description Default
pars dict the parameters dictionary required
layer_keys list the layer keys of the population, if available None
force bool reset the parameters even if they already exist False