aic_selector¶
- tessilator.lc_analysis.aic_selector(x, y, poly_max=3, cov_min=1e-10)[source]¶
Select the detrending polynomial from the Aikaike Information Criterion
This function uses the Aikaike Information Criterion (AIC) to find the most appropriate polynomial order to a set of X, Y data points.
- Parameters:
- x
Iterable The independent variable
- y
Iterable The dependent variable
- poly_max
int, optional, default=3 The maximum polynomial order to test
- cov_min
float A threshold value for the first element of the covariance matrix. Sometimes the AIC will automatically select a higher-order polynomial to a distribution that is clearly best fit by the preceeding lower-order fit. For example, a second-order fit provides a better fit for a perfect straight line. This is a bug in the numerical rounding. Therefore, if the value of the first element of the covariance matrix is less than cov_min for the lower order, then the lower order fit is selected.
- x
- Returns: