covasim.parameters module¶
Set the parameters for Covasim.
-
make_pars
(set_prognoses=False, prog_by_age=True, version=None, **kwargs)[source]¶ 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: - set_prognoses (bool) – whether or not to create prognoses (else, added when the population is created)
- prog_by_age (bool) – whether or not to use age-based severity, mortality etc.
- kwargs (dict) – any additional kwargs are interpreted as parameter names
- version (str) – if supplied, use parameters from this Covasim version
Returns: the parameters of the simulation
Return type: pars (dict)
-
reset_layer_pars
(pars, layer_keys=None, force=False)[source]¶ 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: - pars (dict) – the parameters dictionary
- layer_keys (list) – the layer keys of the population, if available
- force (bool) – reset the parameters even if they already exist
-
get_prognoses
(by_age=True, version=None)[source]¶ Return the default parameter values for prognoses
The prognosis probabilities are conditional given the previous disease state.
Parameters: by_age (bool) – whether to use age-specific values (default true) Returns: the dictionary of prognosis probabilities Return type: prog_pars (dict)
-
get_variant_pars
(default=False, variant=None)[source]¶ Define the default parameters for the different variants
-
get_cross_immunity
(default=False, variant=None)[source]¶ Get the cross immunity between each variant in a sim