# Math Help - Line of Best Fit

1. ## Line of Best Fit

Hi quick question: Does a line of best fit HAVE to be a straight line? because I have a set of data that look like they form a logarithmic function.

see, that does not look good. Any ideas or tips?!

2. ## Re: Line of Best Fit

Yes, a line of best fit has to be a line which is just a short way of saying straight line. All lines are straight!

thank you.

4. ## Re: Line of Best Fit

Originally Posted by sakonpure6
Hi quick question: Does a line of best fit HAVE to be a straight line? because I have a set of data that look like they form a logarithmic function.

see, that does not look good. Any ideas or tips?!

Note that the model \displaystyle \begin{align*} y = A + B\log{(x)} \end{align*} might be appropriate. If we let \displaystyle \begin{align*} X = \log{(x)} \end{align*}, this gives \displaystyle \begin{align*} y = A + B\,X \end{align*}, a LINEAR function.
So what you can do is to evaluate \displaystyle \begin{align*} X \end{align*} for each of your observed x values, and then do a least squares linear regression on the two sets \displaystyle \begin{align*} X \end{align*} and \displaystyle \begin{align*} y \end{align*}. Your model will then be much more accurate, and then it can be written in terms of \displaystyle \begin{align*} \log{(x)} \end{align*} again.