Statistical - Cubic Regression (Cubic Spline Fit) ?
|
06-01-2022, 03:20 PM
Post: #16
|
|||
|
|||
RE: Statistical - Cubic Regression (Cubic Spline Fit) ?
(06-01-2022 06:26 AM)Werner Wrote: I have the impression cubic regression and cubic spline regression are mixed up. We can use the same dataset as in the Cubic Regression Calculator: (0, 1), (2, 0), (3, 3), (4, 5), (5, 4) Code: 0 1 Cubic spline interpolation Equation \( f(x) = \begin{cases}3.1105 \cdot 10^{-1}\cdot x^3 -4.8828 \cdot 10^{-61}\cdot x^2 -1.7442\cdot x + 1.0000, & \text{if } x \in [0,2], \\-8.5465 \cdot 10^{-1}\cdot x^3 + 6.9942\cdot x^2 -1.5733 \cdot 10^{1}\cdot x + 1.0326 \cdot 10^{1}, & \text{if } x \in (2,3], \\-4.5930 \cdot 10^{-1}\cdot x^3 + 3.4360\cdot x^2 -5.0581\cdot x -3.4884 \cdot 10^{-1}, & \text{if } x \in (3,4], \\6.9186 \cdot 10^{-1}\cdot x^3 -1.0378 \cdot 10^{1}\cdot x^2 + 5.0198 \cdot 10^{1}\cdot x -7.4023 \cdot 10^{1}, & \text{if } x \in (4,5].\end{cases} \) We get piecewise defined cubic polynomials that fit all given points. Evaluation \( f(1)=-0.43314 \) Graph Usage Quote:Originally, spline was a term for elastic rulers that were bent to pass through a number of predefined points, or knots. Polynomial interpolation Equation \( f(x)=1.6667 \cdot 10^{-2}\cdot x^{4}-5.6667 \cdot 10^{-1}\cdot x^{3}+ 3.6833\cdot x^{2}-5.7333\cdot x+ 1.0000 \) We get a single polynomial that fits all given points. Evaluation \( f(1)=-1.6000 \) Graph Usage Quote:In numerical analysis, polynomial interpolation is the interpolation of a given data set by the polynomial of lowest possible degree that passes through the points of the dataset. Conclusion Use a cubic spline if you want a function that goes smoothly through the given data points. Disadvantage: The function is defined piecewise. Use polynomial interpolation if you want a single polynomial passing the given data points. Disadvantage: Runge's phenomenon shows that for high values of n, the interpolation polynomial may oscillate wildly between the data points. Use cubic regression when you want to get the cubic polynomial that best fits the given data points. Disadvantage: The polynomial usually does not pass the given data points. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)