03-21-2014 11:24 AM
Hi
Does anyone know how to generate an equation from an XY graph. I had a set of data, generated an interpolated plot of the data set, and my curve/pattern is logarithmic. Though I would like to get the equation of the curve, the info i am really after are the Slope and Bias of the equation. This is the format I think the equation would be in: y = (Slope)*ln(x) + Bias. Any assistance is greatly appreciated. Thanks in advance.
Solved! Go to Solution.
03-24-2014 11:41 AM
Hi AR_Odusanya,
As far as a simple XY graph goes I'm not aware of a way to generate an equation based off the data since it is just a simple indicator. Are you able to post your code?
03-24-2014 12:11 PM
Trying to run a log fit to Y = m ln(x) + c is no different to running a linear fit on Y = m x' + c, where x' = ln(x).
Still, you can do this two ways:
Logarithm fit for a sequence of X and Y will return amplitude and scale.
Consider Y = a ln(bx). We know from simple logarithms that ln(bx) can be expanded to ln(b)+ln(x)
So Y = a ( ln(b) + ln(x) )
Rearranging, Y = a ln(x) + a ln(b) (equivalent to your slope and bias expression)
where a is equal to 'amplitude' and b is equal to 'scale'.
Linear fit for a sequence of X = ln(x) will return slope and intercept.
Consider Y = m ln(x) + c = m X + c
The slope output is m, the intercept is c.