glucopy.metrics.conga#

glucopy.metrics.conga(df: DataFrame, m: int = 1, slack: int = 0, ignore_na: bool = True, ddof: int = 1)[source]#

Calculates the Continuous Overall Net Glycaemic Action (CONGA).

\[CONGA = \sqrt{\frac{1}{k-ddof} \sum_{t=t1} (D_t - \bar D)^2}\]
  • \(ddof\) is the Delta Degrees of Freedom.

  • \(D_t\) is the difference between glycaemia at time t and t minus m hours ago.

  • \(\bar D\) is the mean of the differences (\(D_t\)).

  • \(k\) is the number of differences.

Parameters:
  • df (pandas.DataFrame) – DataFrame containing the CGM values. The dataframe must contain ‘CGM’ and ‘Timestamp’ columns present in glucopy.Gframe.data.

  • m (int, default 1) – Number of hours to use for the CONGA calculation.

  • slack (int, default 0) – Maximum number of minutes that the given time can differ from the actual time in the data.

  • ignore_na (bool, default True) – If True, ignores missing values (not found within slack). If False, raises an error if there are missing values.

  • ddof (int, default 1) – Delta Degrees of Freedom. The divisor used in calculations of standard deviation is N - ddof, where N represents the number of elements.

Returns:

conga – Continuous Overall Net Glycaemic Action (CONGA).

Return type:

float

Notes

This function is meant to be used by glucopy.Gframe.conga()