# Least Squares Fitting - Logarithmic

Is there any software that will fit a set of 2D points using a logarithmic curve?

I found this, which looks like the formulas I need, but I don't think I have a fancy enough calculator to solve that for me.

WolframAlpha has a LeastSquares[] function, but it looks like it only does linear regressions.

-
Is this an example of what you're trying to do: wolframalpha.com/input/… ? –  Derek Allums Aug 12 '12 at 21:58
Any spreadsheet that does linear fits would allow you to take the log of your data before fitting. –  Ross Millikan Aug 12 '12 at 22:18
@unit3000-21: That looks exactly like what I was looking for. Didn't know the syntax. Is there a reference somewhere? Anyway, if you made that an answer, I'd accept it. –  Mark Aug 13 '12 at 0:15

I wouldn't be surprised if Wolfram Alpha is actually doing what Ross suggested: transform the $x$ data by $t_j = \log(x_j)$. Then $y = a \log(b x)$ becomes $y = a t + c$ where $t = \log(x)$ and $c = a \log(b)$. Thus this becomes a linear least-squares problem.
For a standard least-squares in the $y$ direction with the $x$ values considered as exact (which is what is happening here), transforming the $x$ values doesn't cause any "distortion". It really is a linear problem. If you were doing "total least-squares" where errors in both $x$ and $y$ are allowed, you would be right, the problem for a logarithmic fit would be nonlinear. –  Robert Israel Aug 13 '12 at 6:25