models package¶

Cost Functions¶

models.cost_functions.PrintException(e)¶
models.cost_functions.cost_NSIR(self, pars, dataset, initial, t, w)¶
models.cost_functions.cost_SEIR(self, pars, dataset, initial, t, w)¶

The function to compute the error to guide the learning algorithm. It computes the quadratic error.

Parameters:
  • pars (tuple) – Tuple with Beta and r parameters, respectivelly.
  • dataset (list) – The dataset with the respective S, I and R arrays.
  • initial (array) – The initial values of suceptible and infected, respectivelly.
  • t (array) – The time respective to each sample.
  • w (array) – The weight respective to the suceptible and infected errors.
Returns:

The sum of the quadratic error, between simulated and real data.

Return type:

float

models.cost_functions.cost_SIR(self, pars, dataset, initial, t, w)¶

The function to compute the error to guide the learning algorithm. It computes the quadratic error.

Parameters:
  • p (tuple) – Tuple with Beta and r parameters, respectivelly.
  • S (array) – The suceptible data values.
  • I (array) – The infected data values.
  • initial (array) – The initial values of suceptible and infected, respectivelly.
  • t (array) – The time respective to each sample.
  • w (array) – The weight respective to the suceptible and infected errors.
Returns:

The sum of the quadratic error, between simulated and real data.

Return type:

float

models.cost_functions.cost_SIRD(self, pars, dataset, initial, t, w)¶

The function to compute the error to guide the learning algorithm. It computes the quadratic error.

Parameters:
  • p (tuple) – Tuple with Beta and r parameters, respectivelly.
  • S (array) – The suceptible data values.
  • I (array) – The infected data values.
  • initial (array) – The initial values of suceptible and infected, respectivelly.
  • t (array) – The time respective to each sample.
  • w (array) – The weight respective to the suceptible and infected errors.
Returns:

The sum of the quadratic error, between simulated and real data.

Return type:

float

models.cost_functions.cost_dSIR(self, pars, dataset, initial, t, w)¶

The function to compute the error to guide the learning algorithm. It computes the quadratic error.

Parameters:
  • p (tuple) – Tuple with Beta and r parameters, respectivelly.
  • S (array) – The suceptible data values.
  • I (array) – The infected data values.
  • initial (array) – The initial values of suceptible and infected, respectivelly.
  • t (array) – The time respective to each sample.
  • w (array) – The weight respective to the suceptible and infected errors.
Returns:

The sum of the quadratic error, between simulated and real data.

Return type:

float

Differential Models¶

models.differential_models.NSIR(self, y, t, beta, r, betan, alpha, rn, *args)¶
models.differential_models.SEIR(self, y, t, Beta, r, sigma)¶

The function that computes the diferential set of equations of the SEIR Epidemic Model.

Parameters:
  • y (tuple) – Tuple with the suceptible and infected data.
  • t (array) – The time respective to each y set of samples.
  • Beta (float) – The Beta parameter.
  • r (float) – The r parameter.
  • sigma (float) – The sigma parameter.
Returns:

The derivative of the suceptible and infected data.

Return type:

tuple

models.differential_models.SIR(self, y, t, parameters, *args)¶

The function that computes the diferential set of equations of the SIR Epidemic Model.

Parameters:
  • y (tuple) – Tuple with the suceptible and infected data.
  • t (array) – The time respective to each y set of samples.
  • Beta (float) – The Beta parameter.
  • r (float) – The r parameter.
Returns:

The derivative of the suceptible and infected data.

Return type:

tuple

models.differential_models.SIRD(self, y, t, parameters)¶

The function that computes the diferential set of equations of the SIRD Epidemic Model.

Parameters:
  • y (tuple) – Tuple with the suceptible and infected data.
  • t (array) – The time respective to each y set of samples.
  • Beta (float) – The Beta parameter.
  • r (float) – The r parameter.
  • mi (float) – The mi parameter.
Returns:

The derivative of the suceptible and infected data.

Return type:

tuple

Module contents¶

copyright:2010 Marcelo Lima
license:BSD-3-Clause