exp regression?

  • Thread starter jackson marshmallow
  • Start date
J

jackson marshmallow

Hello everyone,

Is there a free Java implementation of an exponential regression algorithm
(i.e. to generate exponential regression function coefficients for f(x) =
A*exp(B*x)+C)?

The excellent JSci package has linear and polinominal regressions, but not
exponential...

If there is not, I will need to write one... Any advice will be
appreciated...
 
J

Jos A. Horsmeier

jackson marshmallow said:
Hello everyone,

Is there a free Java implementation of an exponential regression algorithm
(i.e. to generate exponential regression function coefficients for f(x) =
A*exp(B*x)+C)?

The excellent JSci package has linear and polinominal regressions, but not
exponential...

If there is not, I will need to write one... Any advice will be
appreciated...

If you get rid of the horizontal asymptote C (by inspecting the data
samples and finding an approximate value C'), your equation yields:

f'(x) [= f(x)-C'] = A*exp(B*x)

taking the logarithm on both sides reduces your problem to linear
regression again.

kind regards,

Jos
 
J

jackson marshmallow

Jos A. Horsmeier said:
Hello everyone,

Is there a free Java implementation of an exponential regression algorithm
(i.e. to generate exponential regression function coefficients for f(x) =
A*exp(B*x)+C)?

The excellent JSci package has linear and polinominal regressions, but not
exponential...

If there is not, I will need to write one... Any advice will be
appreciated...

If you get rid of the horizontal asymptote C (by inspecting the data
samples and finding an approximate value C'), your equation yields:

f'(x) [= f(x)-C'] = A*exp(B*x)

taking the logarithm on both sides reduces your problem to linear
regression again.

kind regards,

Jos

That will yield wrong results.
 
J

jackson marshmallow

jackson marshmallow said:
f(x)
=
A*exp(B*x)+C)?

The excellent JSci package has linear and polinominal regressions, but not
exponential...

If there is not, I will need to write one... Any advice will be
appreciated...

If you get rid of the horizontal asymptote C (by inspecting the data
samples and finding an approximate value C'), your equation yields:

f'(x) [= f(x)-C'] = A*exp(B*x)

taking the logarithm on both sides reduces your problem to linear
regression again.

kind regards,

Jos

That will yield wrong results.

PS Sorry Jos, I was in a rush and didn't mean to be rude... I do appreciate
your reply.

Basically, I have been doing something like what you are describing, which
was better than nothing and was easy to code. But what's needed a true
exponential fit.

I also posted this question to sci.math etc.
 
J

Jos A. Horsmeier

jackson marshmallow said:
jackson marshmallow said:
Jos A. Horsmeier said:
Hello everyone,

Is there a free Java implementation of an exponential regression algorithm
(i.e. to generate exponential regression function coefficients for
f(x)
=
A*exp(B*x)+C)?

The excellent JSci package has linear and polinominal regressions, but not
exponential...

If there is not, I will need to write one... Any advice will be
appreciated...

If you get rid of the horizontal asymptote C (by inspecting the data
samples and finding an approximate value C'), your equation yields:

f'(x) [= f(x)-C'] = A*exp(B*x)

taking the logarithm on both sides reduces your problem to linear
regression again.

kind regards,

Jos

That will yield wrong results.

PS Sorry Jos, I was in a rush and didn't mean to be rude... I do appreciate
your reply.

I didn't consider it rude; a bit concise though ;-) But you're right, if
your estimate for the horizontal asymptote C' is way off, the results will
be way off also ...
Basically, I have been doing something like what you are describing, which
was better than nothing and was easy to code. But what's needed a true
exponential fit.

If your sample set is large *and* if the condition number of the resulting
matrix is low (i.e. the fit will be 'fine') a better estimate can be
made for C by elliminating it all together; have a look:

f(x) = A*exp(B*x)+C
f'(x) = A*B*exp(B*x)

(where f'(x) is the derivative of f(x) w.r.t. x)

given your sample value set (x_0, y_0) ... (x_i, y_i) ... (x_n, y_n),
the derivative values can be estimated as follows:

f'(x_i) = (y_i+1-y_i)/(x_i+1-x_i)

The value for C can be estimated then by taking the average of all
the C'_i values from your sample set.

kind regards,

Jos
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top