exp regression?

Discussion in 'Java' started by jackson marshmallow, Jul 17, 2003.

  1. 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...
     
    jackson marshmallow, Jul 17, 2003
    #1
    1. Advertising

  2. "jackson marshmallow" <> wrote in message news:17uRa.1485$...
    > 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
     
    Jos A. Horsmeier, Jul 17, 2003
    #2
    1. Advertising

  3. "Jos A. Horsmeier" <> wrote in message
    news:3f16993a$0$45374$...
    > "jackson marshmallow" <> wrote in message

    news:17uRa.1485$...
    > > 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.
     
    jackson marshmallow, Jul 17, 2003
    #3
  4. "jackson marshmallow" <> wrote in message
    news:puBRa.1579$...
    >
    > "Jos A. Horsmeier" <> wrote in message
    > news:3f16993a$0$45374$...
    > > "jackson marshmallow" <> wrote in message

    > news:17uRa.1485$...
    > > > 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.

    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.
     
    jackson marshmallow, Jul 18, 2003
    #4
  5. "jackson marshmallow" <> wrote in message news:eek:CMRa.136$...
    >
    > "jackson marshmallow" <> wrote in message
    > news:puBRa.1579$...
    > >
    > > "Jos A. Horsmeier" <> wrote in message
    > > news:3f16993a$0$45374$...
    > > > "jackson marshmallow" <> wrote in message

    > > news:17uRa.1485$...
    > > > > 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
     
    Jos A. Horsmeier, Jul 19, 2003
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Craig Matthews

    Latent class regression in Java?

    Craig Matthews, Jul 23, 2003, in forum: Java
    Replies:
    2
    Views:
    534
    Shashank Tripathi
    Jul 26, 2003
  2. BODIN
    Replies:
    0
    Views:
    622
    BODIN
    Dec 8, 2003
  3. Darius Fatakia

    logistic regression implementations

    Darius Fatakia, Nov 16, 2003, in forum: C Programming
    Replies:
    2
    Views:
    349
    Martin Ambuhl
    Nov 16, 2003
  4. nikie

    Linear regression in NumPy

    nikie, Mar 17, 2006, in forum: Python
    Replies:
    15
    Views:
    13,672
    nikie
    Mar 24, 2006
  5. Replies:
    1
    Views:
    409
    John Machin
    Sep 2, 2006
Loading...

Share This Page