pyacs.gts.lib.l1trend.optimization module

Optimization functions for L1-trend analysis.

pyacs.gts.lib.l1trend.optimization.best_l1trend_custom(x, y, criterion_idx, logger=None, component_mask=None)[source]

Find the optimal hyperparameter alpha in l1trend using a custom search algorithm.

Parameters:
  • x (numpy.ndarray) – Input time array

  • y (numpy.ndarray) – Input data array

  • criterion_idx (int) – Index of the criterion to use (-1 for BIC, -2 for AICc, -3 for Cp)

  • logger (logging.Logger, optional) – Logger instance for logging messages

Returns:

(optimal filtered data, history dictionary, optimal alpha)

Return type:

tuple

pyacs.gts.lib.l1trend.optimization.best_l1trend_golden(x, y, criterion_idx, bounds=[-2, 1], tol=0.01, logger=None, component_mask=None)[source]

Find the optimal hyperparameter alpha in l1trend using golden section search algorithm.

Parameters:
  • x (numpy.ndarray) – Input time array

  • y (numpy.ndarray) – Input data array

  • criterion_idx (int) – Index of the criterion to use (-1 for BIC, -2 for AICc, -3 for Cp)

  • bounds (list) – Bounds for the search [lower, upper]

  • tol (float) – Tolerance for convergence

  • logger (logging.Logger, optional) – Logger instance for logging messages

Returns:

Optimally filtered data

Return type:

numpy.ndarray