{ "cells": [ { "metadata": {}, "cell_type": "markdown", "source": [ "# Fitting Methods\n", "This notebook describes various methods available in the gwrefpy package for fitting observation and reference data.\n", "\n", "Currently supported fitting methods include:\n", "- Linear Regression\n", "- Nth order polynomial fitting\n", "- Chebyshev polynomial fitting" ], "id": "c50ea0e738fe2d39" }, { "cell_type": "code", "execution_count": null, "id": "initial_id", "metadata": { "collapsed": true }, "outputs": [], "source": "" }, { "metadata": {}, "cell_type": "markdown", "source": [ "# Linear Regression\n", "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.\n", "\n", "The equation for a linear regression is given by:\n", "\n", "$$y = a_0 + a_1x$$\n", "\n", "where $a_0$ and $a_1$ are the coefficients." ], "id": "154554bb0b406c88" }, { "metadata": {}, "cell_type": "markdown", "source": [ "# Nth Order Polynomial Fitting\n", "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.\n", "\n", "The equation for a Nth order polynomial is given by:\n", "\n", "$$y = a_0 + a_1 x + a_2 x^2 + ... + a_N x^N$$\n", "\n", "where $a_0$, $a_1$, $...$, $a_N$ are the coefficients of the polynomial." ], "id": "a226ea44aebc824f" }, { "metadata": {}, "cell_type": "markdown", "source": "", "id": "dbe8afaba89fa1c5" }, { "metadata": {}, "cell_type": "markdown", "source": [ "# Chebyshev Polynomial Fitting\n", "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.\n", "\n", "The equation for a Chebyshev polynomial of degree N is given by:\n", "\n", "$$y = a_0T_0(x) + a_1T_1(x) + a_2T_2(x) + ... + a_NT_n(x)$$\n", "\n", "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:\n", "\n", "$$T_0(x) = 1$$\n", "\n", "$$T_1(x) = x$$\n", "\n", "$$T_{n+1}(x) = 2xT_n(x) - T_{n-1}(x)$$" ], "id": "56956a578d0d429e" }, { "metadata": {}, "cell_type": "code", "outputs": [], "execution_count": null, "source": "", "id": "5c96914bfc2b31b8" } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" } }, "nbformat": 4, "nbformat_minor": 5 }