Linear curve fitting, or simple linear regression, models the relationship between two variables by fitting a straight line through the data. It assumes the relationship follows:
Here, is the slope of the line and is the y-intercept. The goal is to find the values of and that minimize the sum of the squared differences between the observed and predicted values.
We use the method of least squares, minimizing:
Taking derivatives of with respect to and , and setting them to zero yields:
Once and are calculated, the fitted line can be used to make predictions or interpret the relationship.