Curve fitting and least squares method.

In summary: For part 2, I used the least squares method to approximate my a, b, and Css. 1. I found the function that best fits the data points by minimizing the sum of the squares of the vertical distance between the data points and the fitting function. 2. I found that the function is a polynomial with degree 3. 3. I solved for a and b using the properties of ln(xy) = ln(x)+ln(y). In summary, the function best fits the data points by minimizing the sum of the squares of the vertical distance between the data points and the fitting function. I found that the function is a polynomial with
  • #1
danbone87
28
0

Homework Statement



I have an equation as a function of time. (eq1) C(t) = Css + a(e^.5t) + b(e^.9t) t>0

Where, Css is a constant. then I have 6 data points of time and C (Concentration of a liquid)

1. I have to find an equation to find the maximum time and contains a, b and Css.
2. I have to show the complete least squares derivation based on equation 1 as the approximating function.

First of all, I'm wondering what the difference between 1 and 2 are... both are ways to find tmax. Also, when doing a least squares method, I don't know exactly how to decide what to type of equation to choose to find my a, b and Css. Will a polynomial work since this function involves exponentials... and how would i decide what degree polynomial to use? Since I should have 3 systems of equations should I go up to a third degree polynomial?
 
Physics news on Phys.org
  • #2
Hi, I have an update!

For part 1. I realized from long ago that the max and mins of a function occur when y'=0

So I took the derivative of the function which gave me

C(t) = Css + a(e^.5t) + b(e^.9t) t>0

c'(t)= .5a(e^.5t)*(e^.5t) + .9b(e^.9t)*(e^.9t) = 0

i took the ln of the whole thing

and that gave me

[ln(.5a)*.5t + .5t] + [ln(.9b)*.9t + .9t] = 0

my question now is can use the property that ln(xy) = ln(x)+ln(y) to combine the two ln's and thereby combining the coeffiecients of t such that it is .5t+.9t = .14t

and the whole thing would be .14t*ln(.45ab)= -.14t

... that seems to be wrong considering that the t's cancel out but I can't think of much else...
 
  • #3
If you are still looking for help, you need to look at the purpose of least squares, which is to minimize the sum of the squares of the vertical distance between the data points and the fitting function:

[tex]min \ g= \sum_{i=1}^n[f(a,b,t_i) - y_i]^2[/tex]

Where a and b are the unknown coefficients of the fitting function. To minimize, take the partial derivative of g with respect to each unknown. When terms are collected, the result is a set of simultaneous linear equations that can be solved for a and b.
 
Last edited:

1. What is curve fitting?

Curve fitting is a statistical method used to find the best fitting curve that represents a set of data points. It involves finding the optimal parameters for a mathematical function that can describe the relationship between the independent and dependent variables.

2. What is the least squares method?

The least squares method is a technique used to find the best fitting line or curve by minimizing the sum of the squared errors between the observed data points and the predicted values from the model. It is commonly used in regression analysis to determine the relationship between variables.

3. What are the steps involved in curve fitting using the least squares method?

The steps involved in curve fitting using the least squares method are:

  • 1. Define the problem and determine the type of curve that will best fit the data.
  • 2. Choose a mathematical function and its corresponding parameters.
  • 3. Calculate the predicted values using the chosen function and parameters.
  • 4. Calculate the difference between the observed and predicted values, also known as the residuals.
  • 5. Square the residuals and sum them to get the sum of squared errors (SSE).
  • 6. Adjust the parameters to minimize the SSE using an optimization algorithm such as gradient descent.
  • 7. Repeat steps 3-6 until the SSE is minimized and the best fitting curve is obtained.

4. What are some common applications of curve fitting and the least squares method?

Curve fitting and the least squares method are commonly used in various fields such as economics, engineering, physics, and biology. Some specific applications include analyzing trends in financial data, predicting future stock prices, fitting growth curves for population studies, and determining the relationship between variables in scientific experiments.

5. Are there any limitations or assumptions when using the least squares method?

One limitation of the least squares method is that it assumes the error or noise in the data is normally distributed and independent. Additionally, it may not always capture complex relationships between variables, and the chosen function may not accurately represent the underlying data. It is important to assess the appropriateness of the method for a given dataset and consider other techniques if necessary.

Similar threads

  • Calculus and Beyond Homework Help
Replies
6
Views
641
  • Calculus and Beyond Homework Help
Replies
2
Views
361
  • Calculus and Beyond Homework Help
Replies
12
Views
3K
  • Calculus and Beyond Homework Help
Replies
3
Views
264
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
117
  • Calculus and Beyond Homework Help
Replies
7
Views
703
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
472
  • Calculus and Beyond Homework Help
Replies
1
Views
986
  • Calculus and Beyond Homework Help
Replies
9
Views
1K
Back
Top