compute_f

compute_f(series: numpy.ndarray, k: int, p: numpy.ndarray, pp: numpy.ndarray) Tuple[numpy.ndarray, list][source]

Compute F. F[a][b][k] - minimum approximation error on series[a:b+1] with k outliers.

Reference.

Parameters
  • series (numpy.ndarray) – array to count F

  • k (int) – number of outliers

  • p (numpy.ndarray) – array of sums of elements, p[i] - sum from 0th to i elements

  • pp (numpy.ndarray) – array of sums of squares of elements, pp[i] - sum of squares from 0th to i elements

Returns

result – array F, outliers_indices

Return type

np.ndarray