Can I Use a Natural Log Function for Least Square Fitting?

Click For Summary

Discussion Overview

The discussion revolves around the application of natural logarithm functions in the context of least squares fitting, specifically addressing the calculation of coefficients in the fitting process. Participants explore the mathematical formulation and summation indices involved in the equations presented.

Discussion Character

  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant seeks clarification on whether the index 'i' in the summations for least squares fitting is consistent across multiple equations.
  • Another participant confirms that 'i' represents the index for all summations, running from 1 to n, where n is the number of data points.
  • A participant expresses confusion regarding the formulation of the numerator for coefficient b and proposes a specific summation expression.
  • A subsequent reply challenges the proposed expression for the numerator, stating that it cannot be simplified as suggested and emphasizes the need to calculate all three summations as per the formula provided by Wolfram.
  • Another suggestion is made to plot y versus x on a logarithmic scale, indicating that this should yield a straight line and that the graphics package will determine the best least squares fit automatically.

Areas of Agreement / Disagreement

Participants exhibit some agreement on the need for careful calculation of summations, but there is disagreement regarding the simplification of the numerator for coefficient b, with differing interpretations of the correct approach.

Contextual Notes

The discussion includes unresolved mathematical steps and assumptions regarding the summation indices and the formulation of the least squares fitting equations.

JoJoQuinoa
Messages
17
Reaction score
0
Hello,

I'm trying to follow Wolfram to do a least square fitting. There are multiple summations in the two equations to find the coefficients. Are the i's the same in this case?

Thanks!
 
Mathematics news on Phys.org
JoJoQuinoa said:
Hello,

I'm trying to follow Wolfram to do a least square fitting. There are multiple summations in the two equations to find the coefficients. Are the i's the same in this case?

Thanks!
In both equations, i is the index of all of the summations. These summations run for i = 1, 2, 3, and so on, up to n. Here n is the number of points you're fitting to the log curve.
 
  • Like
Likes   Reactions: JoJoQuinoa
@Mark44

Sorry I just looked at it and got confused again. So for coefficient b, can I write the numerator as
##\Sigma_{i=1}^n (n*y_i*ln(x_i)-y_i*ln(x_i))##.
 
Last edited:
JoJoQuinoa said:
@Mark44

Sorry I just looked at it and got confused again. So for coefficient b, can I write the numerator as
##\Sigma_{i=1}^n (n*y_i*ln(x_i)-y_i*ln(x_i))##.
No. The formula shown in the Wolfram page for the numerator of b is
$$n\sum_{i =1}(y_i\ln(x_i)) - (\sum_{i = 1}y_i)(\sum_{i = 1}\ln(x_i)$$
You can't simplify things as you have done. You need to calculate all three summations. Once you have these numbers, multiply the first summation by n, multiply the second and third summations together, and then subtract as shown.
 
Just plot y vs x, with x plotted on a log scale (by your graphics package). The result should be a straight line, and the graphics package should automatically determine the best least squares fit equation to the data.
 

Similar threads

  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 19 ·
Replies
19
Views
7K
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
6
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 10 ·
Replies
10
Views
4K