# Logarithmic Nonlinear Regression

• Jul 23rd 2011, 09:51 PM
RussianScience
Logarithmic Nonlinear Regression
I need to find a best fitted curve to a set of points using logarithmic nonlinear regression, from what I've read it seems like there are more accurate methods than the logarithmic out there, but nonetheless the logarithmic method is the one I need. I've had a bit of a hard time finding the information I need and I was wondering if anyone would be kind enough to explain it to me or link to a page that does so. Thanks in advance.
• Jul 23rd 2011, 10:49 PM
CaptainBlack
Re: Logarithmic Nonlinear Regression
Quote:

Originally Posted by RussianScience
I need to find a best fitted curve to a set of points using logarithmic nonlinear regression, from what I've read it seems like there are more accurate methods than the logarithmic out there, but nonetheless the logarithmic method is the one I need. I've had a bit of a hard time finding the information I need and I was wondering if anyone would be kind enough to explain it to me or link to a page that does so. Thanks in advance.

A bit more explanation/background is really needed here.

A common approach to these kinds of problems is to apply a transformation to one or both of the independent and/or the dependent variables to make the problem linear and then use linear regression. Other than that a more complex method could be used but we would need to know more about the specific problem and how the solution is to be used.

CB
• Jul 23rd 2011, 11:02 PM
RussianScience
Re: Logarithmic Nonlinear Regression
I have a set of x and y coordinates and I need to find a function for the best fit curve. the function should take the form of f(y) = A * ln(B*x+1) + f. My problem is to find those A, B and f (these are random variables i picked), I believe the f represents error, but I do not know how to find it or the other 2 variables.
• Jul 24th 2011, 01:24 AM
CaptainBlack
Re: Logarithmic Nonlinear Regression
Quote:

Originally Posted by RussianScience
I have a set of x and y coordinates and I need to find a function for the best fit curve. the function should take the form of f(y) = A * ln(B*x+1) + f. My problem is to find those A, B and f (these are random variables i picked), I believe the f represents error, but I do not know how to find it or the other 2 variables.

You want a regression function of the form:

$\displaystyle y=A \ln(Bx+1)+h$

where $\displaystyle A, B$ and $\displaystyle h$ are unknown constants you want to find.

Well the $\displaystyle +1$ makes this difficult to transform into a linear regression problem (though someone with more time or more ingenious than I might be able to do so), so you probably looking at a general non-linear (unconstrained) optimisation problem of the form:

Minimise:

$\displaystyle Ob(A,B,h) = \sum_{i=1}^N [y_i-(A\ln(Bx+1)+h)]^2$

where $\displaystyle (x_i,y_i), i=1, ... , N$ are your data points.

CB
• Jul 24th 2011, 02:35 AM
RussianScience
Re: Logarithmic Nonlinear Regression
Thank you so much for your help! There is still a small problem, I'm not sure what the notation Ob(A, B, h) signifies and I'm still unsure as to what each variable means.

EDIT: I have a feeling this is much more than can be explained in a thread, if you could just point me in the right direction as to where to start learning I would be grateful.

EDIT2: Is this what I'm looking for? http://www.mit.edu/~9.520/spring08/C...optlecture.pdf
• Jul 24th 2011, 05:14 AM
CaptainBlack
Re: Logarithmic Nonlinear Regression
Quote:

Originally Posted by RussianScience
Thank you so much for your help! There is still a small problem, I'm not sure what the notation Ob(A, B, h) signifies and I'm still unsure as to what each variable means.

Ob(A,B,h) denotes the objective function we need to find the minimum of to obtain the regression equation parameters, which are the parameters of the objective.

Quote:

EDIT: I have a feeling this is much more than can be explained in a thread, if you could just point me in the right direction as to where to start learning I would be grateful.

EDIT2: Is this what I'm looking for? http://www.mit.edu/~9.520/spring08/C...optlecture.pdf
Sort of, but you will never need to deal with this detail yourself, for practical purposes you will use a package with the methods build in. One such (not the best but possibly the most accessible) is the solver add-in that is supplied with Excel.

CB
• Jul 24th 2011, 03:47 PM
RussianScience
Re: Logarithmic Nonlinear Regression
Hmm... Thing is I'm doing this for someone else. I'm trying to create a permanent method by which they can do it anytime they wish. My original plan was to write a program, but that would require me to learn a good part of that pdf file which would be pretty challenging since I do not yet have the background in math that I probably need. If I can somehow save the procedure in excel or matlab so it can be used over again with the click of a button then I guess all i have to learn is how to manipulate the program to do what I need, otherwise I've got a lot of work to do...
• Jul 24th 2011, 06:45 PM
CaptainBlack
Re: Logarithmic Nonlinear Regression
Quote:

Originally Posted by RussianScience
Hmm... Thing is I'm doing this for someone else. I'm trying to create a permanent method by which they can do it anytime they wish. My original plan was to write a program, but that would require me to learn a good part of that pdf file which would be pretty challenging since I do not yet have the background in math that I probably need. If I can somehow save the procedure in excel or matlab so it can be used over again with the click of a button then I guess all i have to learn is how to manipulate the program to do what I need, otherwise I've got a lot of work to do...

There are C++, Fortran, ... source files available for most methods for free on the internet

CB
• Jul 30th 2011, 05:11 PM
RussianScience
Re: Logarithmic Nonlinear Regression
Sorry to bump this somewhat old thread, but could I use calculus to find the minimum of the function at every coordinate?

EDIT: my post seems to make less sense the more I think about it.
• Sep 13th 2011, 11:43 PM
JJacquelin
Re: Logarithmic Nonlinear Regression
Quote:

I have a set of x and y coordinates and I need to find a function for the best fit curve. the function should take the form of f(y) = A * ln(B*x+1) + f. My problem is to find those A, B and f (these are random variables i picked), I believe the f represents error, but I do not know how to find it or the other 2 variables.
Let change the notations in order to be consistent with the paper referenced below.
z = A*ln(B*t+1)+F
A, B, F are the parameters to be optimized.
Input data are (t1, z1), (t2,z2), ... (tn,zn)
Let transform the relationship as :
exp(z) = exp(F)*(B*t+1)^A
exp(z/A) = exp(F/A)*(B*t+1)
t = (-1/B) +(1/B)*exp(z/A)*exp(-F/A)
Let:
y = t
x = z
a = -1/B
b = (1/B)exp(-F/A)
c = 1/A
This leads to the relationship :
y = a + b*exp(c*x)
with the input data x and y known as :
(x1=z1, y1=t1), (x2=z2, y2=t2), ..., (xn=zn, yn=tn)
So we have to do a non-linear regression on the form y = a+b*exp(c*x)
A process of computation for this kind of regression is provided in the paper :
"Regressions et equations integrales" , page 16-17, which is very simple in practice because the computation doesn't requires recursive calculus not successive approximates.
That way, you obtain optimized values for a, b and c.
Then A=1/c ; B=-1/a ; F=-(1/c)*ln(b-(1/a))
The paper in written in French, but you don't need to read the theory. Just apply the instructions (Box, p.17). Link to acces to the paper entitled "Regressions et equations integrales" :
Scribd