Fitting Methods#

This notebook describes various methods available in the gwrefpy package for fitting observation and reference data.

Currently supported fitting methods include:

  • Linear Regression

  • Nth order polynomial fitting

  • Chebyshev polynomial fitting

Linear Regression#

The linear regression fitting method fits a straight line to the data using the least squares method. It is suitable for data that exhibits a linear relationship.

The equation for a linear regression is given by:

\[y = a_0 + a_1x\]

where \(a_0\) and \(a_1\) are the coefficients.

Nth Order Polynomial Fitting#

The Nth order polynomial fitting method fits a polynomial of degree N to the data. This method is useful when more degrees of freedom are needed to capture the relationship between the variables.

The equation for a Nth order polynomial is given by:

\[y = a_0 + a_1 x + a_2 x^2 + ... + a_N x^N\]

where \(a_0\), \(a_1\), \(...\), \(a_N\) are the coefficients of the polynomial.

Chebyshev Polynomial Fitting#

The Chebyshev polynomial fitting method uses Chebyshev polynomials to fit the data. Chebyshev polynomials are orthogonal polynomials that can provide a good approximation for functions over a specific interval.

The equation for a Chebyshev polynomial of degree N is given by:

\[y = a_0T_0(x) + a_1T_1(x) + a_2T_2(x) + ... + a_NT_n(x)\]

where \(T_N(x)\) is the Chebyshev polynomial of degree \(N\) and \(a_0\), \(a_1\), \(...\), \(a_N\) are the coefficients of the polynomial. The Chebyshev polynomials are defined recursively as:

\[T_0(x) = 1\]
\[T_1(x) = x\]
\[T_{n+1}(x) = 2xT_n(x) - T_{n-1}(x)\]