Formulating Curves: Techniques for Nonlinear Data Fitting

  • Thread starter Thread starter S&S
  • Start date Start date
  • Tags Tags
    Curve
Click For Summary

Homework Help Overview

The discussion revolves around techniques for fitting curves to nonlinear data, particularly in the context of scientific research and data analysis. Participants explore the least squares method and its application to polynomial fitting, as well as the challenges of determining the appropriate functional relationship for nonlinear data.

Discussion Character

  • Exploratory, Conceptual clarification, Mathematical reasoning, Assumption checking

Approaches and Questions Raised

  • Participants discuss the least squares technique for fitting curves, questioning how to determine coefficients for polynomial functions. There is also exploration of nonparametric fitting methods and the role of understanding the underlying system generating the data.

Discussion Status

The discussion is active, with participants sharing insights about different fitting methods, including polynomial fitting and smoothing splines. Some guidance is offered regarding the nature of data fitting and the importance of understanding the system behind the data. Multiple interpretations of fitting techniques are being explored.

Contextual Notes

Participants note the limitations of higher-order polynomials in fitting data and the potential for algorithms to perform curve fitting without specifying a functional form. There is an emphasis on the need for knowledge about the data-generating process.

S&S
Messages
11
Reaction score
0
This is just a general asking. It doesn't related with my current study. If someone can point out for me, just give me more knowleges.

In my class I learned the least square technique which allow us draw a best fitted line between observed depent and indepent varivables. Then I think if my observation is a curve that can be much more complex than a straight line, how can I formulate it. I think this thing should be very important in scientific research and real life analysis.

Would you guys tell me how to deal with curves? Or you also can figure me some key words which I can do some search and read by myself. I think these things should not be hard. If I can aways know something that my classmates don't know, I will be definitely better than them, right? :wink:

Cheers
 
Physics news on Phys.org
I can demonstrate by example. Suppose you had a data set that you thought could be well fitted by a parabola. Your data set would look something like [tex]\{x_n,y_n\}[/tex] with n running up to N, and your fit function looks something like [tex]y = a + bx + cx^2[/tex]. So the question then is, how to determine a, b, and c using least squares? The most direct way to do this is to use matrices. Let's take N = 4 just to be definite. Define a matrix [tex]X[/tex],
[tex] X = \left[\begin{array}{ccc} 1 & x_1 & x^2_1 \\ 1 & x_2 & x^2_2 \\ 1 & x_3 & x^2_3 \\ 1 & x_4 & x^2_4 \end{array} \right],[/tex]
a vector [tex]Y[/tex],
[tex] X = \left[\begin{array}{c} y_1 \\ y_2 \\ y_3 \\ y_4 \end{array} \right][/tex]
and another vector [tex]C[/tex],
[tex] C = \left[\begin{array}{c} a \\ c \\ c \end{array} \right].[/tex]
What are each of these matrices, X is the matrix of x values, Y is the vector of y values, and C is the matrix of unknown coeffecients. You can now convince yourself that the equation you would like to solve is
[tex] X C = Y,[/tex]
but in general this equation has no exact solution, so instead you find a least squares solution. The least squares solution of this matrix equation gives a vector C that contains the numerical values of your coeffecients that give a least squares fit based on the parabola. Hopefully you can see how to generalize this procedure for larger N or more complicated fitting functions. Of course, this method is only the beginning of a more comprehensive treatment.
 
Last edited:
The least squares method is not limited to linear approximations, it is quite general and can be applied to polynomials in general. The trouble is that given arbitrary order, there is some polynomial that is an EXACT fit to your data.
Because of this ability of higher order polynomials to mold themselves to a data set they are not very useful for THIS purpose. If your data is nonlinear then you need to be able to guess, or know what functional relationship to expect in your data. There is no way that the data alone can revel its true mathematical nature. How do you learn the functional nature of your data? By understanding the system which generated it is the first step. You might say that this is what being a scientist is all about.
We have a https://www.physicsforums.com/showthread.php?p=806673#post806673" for this.
 
Last edited by a moderator:
thank you guys, this's what I'm talking about.

However, things getting more interesting. I used to use a graph tool which based on MS Excel and it's also programed by some higher stage research students in my school. This graph tool has two modes. First is the linear fit graphing which is drawing a best fit line for input data. The second mode is drawing a smooth curve from data. That thing never asked me to specify a polynomial function.

According to your method, I think, the algorithm they programed the graph tool must can draw the graph without knowing anything from the function which determines the curve. How could that algorithm looks like, any idea?
 
Last edited:
You're welcome S&S,

Your program was probably doing what is usually called nonparametric fitting which is essentially interpolation. Probably the program finds a smoothing spline by guessing some reasonable value of a smoothness parameter based on your data (this sort of makes this method parametric, but the thing is still using splines rather than a single global function). Probably you could input this number yourself if you knew how. Alternatively, the program may just spit out a cubic spline which is simply a curve made of third order polynomials connecting each data point.

I would like to emphasize what Integral mentioned which is that data fitting is an art, and it requires you to know a lot about the system you are studying. Just asking the computer to draw a smooth curve through your data doesn't really tell you much, although it may look pretty.
 
Last edited:

Similar threads

Replies
6
Views
2K
Replies
7
Views
2K
  • · Replies 9 ·
Replies
9
Views
5K
  • · Replies 11 ·
Replies
11
Views
4K
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 22 ·
Replies
22
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K