utils#
Numerical utilities for running Covasim.
These include the viral load, transmissibility, and infection calculations at the heart of the integration loop.
Functions
Draw a sample from the distribution specified by the input. |
|
Return a probability density function for the specified distribution. |
|
Reset the random seed -- complicated because of Numba, which requires special syntax to reset the seed. |
|
Perform multiple binomial (Bernolli) trials |
|
Binomial "filter" -- the same as n_binomial, except return the elements of arr that succeeded. |
|
Binomial (Bernoulli) trials each with different probabilities. |
|
An array of multinomial trials. |
|
|
A Poisson trial. |
|
An array of Poisson trials. |
An array of negative binomial trials. |
|
|
Choose a subset of items (e.g., people) without replacement. |
|
Choose a subset of items (e.g., people), with replacement. |
Choose n items (e.g. people), each with a probability from the distribution probs. |
|
Returns the indices of the values of the array that are true: just an alias for arr.nonzero()[0]. |
|
Returns the indices of the values of the array that are false. |
|
Returns the indices of the values of the array that are not-nan. |
|
Returns the indices of the values of the array that are not-nan. |
|
Returns the indices that are true in the array -- name is short for indices[true] |
|
Returns the indices that are true in the array -- name is short for indices[false] |
|
Returns the indices that are defined in the array -- name is short for indices[defined] |
|
Returns the indices that are undefined in the array -- name is short for indices[undefined] |
|
Returns the indices that are true in the array -- name is short for indices[true[indices]] |
|
Returns the indices that are false in the array -- name is short for indices[false[indices]] |
|
Returns the indices that are defined in the array -- name is short for indices[defined[indices]] |
|
Returns the indices that are undefined in the array -- name is short for indices[defined[indices]] |