epipylib.core package

This core package contains the fitting function.

Fit

A collection of basic fitting and statistic functions for EpiPy.

epipylib.core.fit.fit(model, xdata, N0, ydata=None, params=None, iter=10)
Parameters:
  • model (callable) – Function which defines an epidemic mo
  • xdata (array) – Observation steps
  • N0 (tuple) – Model values at initial observation step
  • ydata (array) – Infected individuals
  • params (tuple) – Epidemic model parameters
  • iter (int) – Number of iterations
Returns:

The fitted epidemic model, used parameters and correlation coefficient.

Return type:

tuple(array, array, float/None)

Utils

A collection of useful functions for the fitting process.

epipylib.core.utils.corr_coef(ydata_1, ydata_2)

Returns the correlation coefficient between y-axis data.

Parameters:
  • ydata_1 (array) – Data of y-axis-1
  • ydata_2 (array) – Data of y-axis-2
Returns:

The correlation coefficient of linear least-squares regression for two sets.

Return type:

float