Details and Options
ResourceFunction["FitPowerLaw"] effectively fits the function a xb to the data, but does so by fitting the linear function c x+d to the log of the data.
ResourceFunction["FitPowerLaw"] fits in 'log space' such that fits that span multiple decades of data are not dominated by a few of the largest values and the smallest values are basically neglegible. The errors are therefore not in the sense of a classical least-square but rather the square of the log of the ratio of the fitted value and the original data. Visually this then results in a 'good fit' when the data is visualized in a log-log plot of the data.
The data data should either be a list of points {y1, y2, y3, …,yn} (to which the x coordinates 1 through n are assigned), or the data is {x,y} pairs: {{x1,y1},{x2,y2},…}, for a list of lists of data ResourceFunction["FitPowerLaw"] will fit each sublist, returning in that case a list of associations.
Only positive values are fitted. Negative points are ignored.
ResourceFunction["FitPowerLaw"] has the following options:
If both options are given, only the "Prefactor" option is used.
ResourceFunction["FitPowerLaw"] returns an
Association with fit and fit parameters.