Nonlinear Equation Fitting: Exploring Solutions

In summary, the idea is that you can fit a model to data using non-linear least squares, but if the parameters change with x, the fit will not be accurate.
  • #1
patric44
296
39
Homework Statement
why nonlinear least square method will not work well with the function
y=kx/(5+cx)
Relevant Equations
y=kx/(5+cx)
I was trying to fit a set of data to the nonlinear equation
$$
y=\frac{kx}{5+cx}
$$
and find the parameters k,c that will result in a best fit, but (I was told without explanation) that the parameters change as we increase x, so regular fitting techniques such as nonlinear least square will not work?
can any one explain this to me, if the parameters vary as a function of the independent variable what is the best way for the fitting, and is that even possible?
 
Physics news on Phys.org
  • #2
The idea of fitting is based on the assumption that the parameters do NOT change with x.
Start with a plot of the data.
 
  • Like
Likes patric44 and topsquark
  • #3
If there are no limits on the behavior of the parameters ##k## and ##c##, it is not only possible to fit the data, it is too easy. In that case, you could always just set ##c=1## and ##k_i = y_i \frac {5+x_i} {x_i}##. If there are no repeated ##x_i## values associated with non-equal ##y_i## values, this would give you a perfect fit. If there are some repeated values in ##x_i##s, you can just use the mean of the associated ##y_i## values. In some cases, this might give you a reasonable model, but I would not count on it.
You do not say if there is any random behavior in the data, or what the nature of the random behavior might be.
 
  • Like
Likes patric44 and topsquark
  • #4
patric44 said:
I was told without explanation

Yeah...

What's the range of your ##x## ? If it's in the several thousands ##y## is a constant !

##\ ##
 
  • Like
Likes patric44 and topsquark
  • #5
there is a limit on the values of k,c I suppose, they are related to some constants about the system.
the values of x is discrete like 2,4,6,... and no values in between, the values of y ranges from 100 to say 3000 and so on, what I am confused about is how its possible for a parameter to vary as a function of the independent variable like i was told?!, I mean if they really change then no fit will be accurate? not only the non linear least squares
 
  • #6
patric44 said:
what I am confused about is how its possible for a parameter to vary as a function of the independent variable like i was told?!, I mean if they really change then no fit will be accurate? not only the non linear least squares
If the parameters ##k## and ##c## change and you perform a non-linear least squares fit to determine the best CONSTANT ##k## and ##c##, then the fit will not be accurate. However, if you allow a different model, then you might get a good enough fit. Or you might try something like a cubic spline, which would fit the data in pieces with a continuous derivative. It all depends on what you want to use the model for.
 
  • Like
Likes patric44
  • #7
FactChecker said:
If the parameters ##k## and ##c## change and you perform a non-linear least squares fit to determine the best CONSTANT ##k## and ##c##, then the fit will not be accurate. However, if you allow a different model, then you might get a good enough fit. Or you might try something like a cubic spline, which would fit the data in pieces with a continuous derivative. It all depends on what you want to use the model for.
the idea is that I want to determine the values of k,c for the specific model given by ##y=kx/(5+cx)##, because I will use the formula of the model in further calculations. from what I unstrood from you guys now I believe that the person who told me that the parameters vary could be mistaken or misinterpreted something, I really don't know
 

1. What is a nonlinear equation?

A nonlinear equation is an equation that does not have a straight line as its graph. This means that the relationship between the variables in the equation is not proportional and cannot be represented by a linear function.

2. Why is nonlinear equation fitting important?

Nonlinear equation fitting is important because many real-world phenomena cannot be accurately described by linear equations. Nonlinear equations allow for more complex and accurate modeling of these phenomena, making it a crucial tool in scientific research and data analysis.

3. How do you fit a nonlinear equation to data?

There are various methods for fitting a nonlinear equation to data, such as the least squares method, the gradient descent method, and the Gauss-Newton method. These methods involve finding the best parameters for the equation that minimize the difference between the predicted values and the actual data.

4. What are some challenges of nonlinear equation fitting?

Nonlinear equation fitting can be challenging because it requires a good understanding of the data and the underlying phenomenon, as well as knowledge of different fitting methods. It can also be computationally intensive and may require a large amount of data to accurately fit the equation.

5. How can you assess the accuracy of a fitted nonlinear equation?

There are several ways to assess the accuracy of a fitted nonlinear equation, such as calculating the residual sum of squares (RSS), which measures the difference between the predicted values and the actual data. Other methods include evaluating the goodness of fit, such as the coefficient of determination (R-squared), and visually inspecting the plot of the fitted equation against the data.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
988
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
487
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
16
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
28
Views
3K
  • Calculus and Beyond Homework Help
Replies
9
Views
3K
  • Calculus and Beyond Homework Help
Replies
1
Views
2K
  • Calculus and Beyond Homework Help
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
14
Views
2K
Back
Top