Core¶
Core provides a framework for the implementation of SEIR and Related Models.
Overview:
SEIR Core¶
- class seirmo.SEIRForwardModel[source]¶
Abstract base class for forward SEIR and Related models.
Extends
pints.ForwardModel.- simulate(parameters, times)[source]¶
Forward simulation of a model for a given time period with given parameters Returns a sequence of length
n_times(for single output problems) or a NumPy array of shape(n_times, n_outputs)(for multi-output problems), representing the values of the model at the giventimes.- Parameters:
parameters (list | numpy.ndarray) – An array-like object with parameter values of length
n_parameters().times (list | numpy.ndarray) – An array-like object with time points.
- class seirmo.SEIRParameters(parameterNames: List[str])[source]¶
Base Parameter Class for SEIR and Related Forward Models
- class seirmo.SEIROutputCollector(outputNames: List[str])[source]¶
Base Class for Accumulating the Output Data from SEIR and Related Forward Models
- begin(*args, **kwargs)[source]¶
Abstract method which is called before observations from simulation are reported.
This allows for subclasses to pre-initialize a datastructure for when observations are then reported.
- report(row)[source]¶
Abstract Method which is for reporting observations from each iteration of a simulation.
This allows for subclasses to perform extra operations on the data.
Also allows for subclasses to filter / decide which observations should be stored.
- report_all(data)[source]¶
Save all Datapoints to the OutputCollector.
Overwrites any existing data with this.
: param: data np.ndarray: Data to save.
- class seirmo.StochasticOutputCollector(outputNames: List[str])[source]¶
- begin(times)[source]¶
Abstract method which is called before observations from simulation are reported.
This allows for subclasses to pre-initialize a datastructure for when observations are then reported.
- report(data: ndarray) array[source]¶
Report data as a column vector into an array at each timestep.
- Parameters:
data – numpy array containing the data of the model resolution
- Returns:
numpy array containing the model solution
- retrieve_time(index: int) ndarray[source]¶
Return data as a column vector at a time point requested. Asserts timepoint is within the ‘past’ of the model.
- Parameters:
time_point – specified time at which we want the data
- Returns:
data as a column for the specified time step
- Return type:
numpy array column