How to calculate parameters of a logarithmic approximation trendline?

2.6k Views Asked by At

I have a set of (Y) data $\left\{y_1, y_2, ..., y_n \right\}$ and a set of (X) $\left\{x_1, x_2, ..., x_n \right\}$ which I use to build a graph. I need to place a logarithmic trendline over the graph, and in order to do that I need to calculate its parameters.

$$y = c·ln(x) - b$$

Thus I need a formula to calculate (c) and (b) based on (X) and (Y).

I'm ultra knew to this level of math, and I know that there's a software to do that, but I just want to understand how it works. Thank you in advance!

2

There are 2 best solutions below

0
On BEST ANSWER
1
On

The question is a little confusing, because you mention fitting a logarithmic trendline, but then you suggest using a linear formula of the form $y=cx-b$.

This would all make sense if your $x$ values were already the logarithms of some original data points, say $z_i$, where $x_i = \log z_i$. Then fitting with a linear formula $y=cx-b$ would be equivalent to fitting with a logarithmic formula $y = c\log z - b$.

If you want to fit a linear equation to your $x$-$y$ data, you can find the available techniques by searching for terms like "linear regression" or "least squares line".

If you just want to play around with various types of fitting, try using the "Add Trendline" function in Microsoft Excel. It does both linear and logarithmic fitting, plus a few others.