Results 1 to 9 of 9

Math Help - Curve Fitting 2

  1. #1
    Super Member
    Joined
    Jun 2008
    Posts
    829

    Curve Fitting 2

    In a given experiment, measurements taken showed that the number of
    elements of a bacterial population decreased with time, so
    approximately exponential:

    time - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 -8 - 9 - 10
    amount - 419 - 274 - 181 - 122 - 85 - 61 - 46 - 36 - 30 - 26 - 24

    Try adjusting the points above by a function of type:
    \phi (x) = a_1 e^{a_2 x}


    My solution:
    I find z(x) = ln(x) (*ln of each amount*)
    g1(x) = 1; g2(x) = x;

    I find:
    a11 = 11
    a12=a21 = 55
    a22 = 385
    b1 = 47,4564
    b2 = 205,1156

    Matrix x Vector(beta1 and beta2) = Vector (b1 and b2)

    a1 = expoent(beta1) = 322,37
    a2 = beta2 = -0,2923

    Is that right?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    Do you mean
    Try fitting the points above...
    ? Because, if so, I can think of at least two ways to solve this problem, one of them probably easier than the other.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    MHF Contributor

    Joined
    Apr 2005
    Posts
    15,417
    Thanks
    1329
    You are writing variables without saying what they mean and leaving us to guess exactly what you are doing. Are you trying to do a "least squares" exponential fit? If so, what formulas are you using?
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Super Member
    Joined
    Jun 2008
    Posts
    829
    Quote Originally Posted by HallsofIvy View Post
    You are writing variables without saying what they mean and leaving us to guess exactly what you are doing. Are you trying to do a "least squares" exponential fit? If so, what formulas are you using?
    Sorry, I use fit by exponential functions

    I need to find:
    a_1 and a_2

    I rode the table:
    time - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 -8 - 9 - 10
    amount - 419 - 274 - 181 - 122 - 85 - 61 - 46 - 36 - 30 - 26 - 24
    ln(amount) - 6,0379 - 5,6131 - 5,1985 - 4,8040 - 4,4426 - 4,1109 - 3,8286 - 3,5835 - 3,4012 - 3,2581 - 3,1780

    g_1(x) = 1;
    g_2(x) = x;

    I find:
    a_{11} = \sum_{k=1}^{11} g_1 (x_k) g_1(x_k) = \sum_{k=1}^{11} 1 = 11

    a_{12} = a_{21} = \sum_{k=1}^{11} g_2 (x_k) g_1(x_k) = \sum_{k=1}^{11} x_k = 55

    a_{22} = \sum_{k=1}^{11} g_2 (x_k) g_2(x_k) = \sum_{k=1}^{11} (x_k)^2 = 385

    b_1 = \sum_{k=1}^{11} f(x_k) g_1(x_k) = \sum_{k=1}^{11} f(x_k) = 47,4564

    b_2 = \sum_{k=1}^{11} f(x_k) g_2(x_k) = \sum_{k=1}^{11} f(x_k) x_k = 205,1156

    Matrix = (a11, a12, a21, a22) x Vector(Beta1, Beta2) = Vector(b1,b2)

    \beta_1 = 5,7757
    \beta_2 = -0,2923

    a_1 = e^{\beta_1} = 322,57
    a_2 = \beta_2 = -0,2923

    It's correct ?
    Follow Math Help Forum on Facebook and Google+

  5. #5
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    Your numbers are fine for a linear fit to the logarithm data. However, the plot of the logarithm of the data looks a lot more like a quadratic than a straight line. That is, you can write

    \ln(\phi(x))=\ln(a_{1})+a_{2}x=5.7763-0.2924x, with an R^{2} value of 0.965. That's good, but not great. On the other hand, if you go with a quadratic fit to the logarithm data, that is, you assume

    \phi(x)=e^{ax^{2}+bx+c}, then

    \ln(\phi(x))=ax^{2}+bx+c=0.0198 x^{2}-0.4905x+6.0734, with an R^{2} value of 0.9995, which is an incredibly good fit.

    Just a thought.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Super Member
    Joined
    Jun 2008
    Posts
    829
    Quote Originally Posted by Ackbeet View Post
    Your numbers are fine for a linear fit to the logarithm data. However, the plot of the logarithm of the data looks a lot more like a quadratic than a straight line. That is, you can write

    \ln(\phi(x))=\ln(a_{1})+a_{2}x=5.7763-0.2924x, with an R^{2} value of 0.965. That's good, but not great. On the other hand, if you go with a quadratic fit to the logarithm data, that is, you assume

    \phi(x)=e^{ax^{2}+bx+c}, then

    \ln(\phi(x))=ax^{2}+bx+c=0.0198 x^{2}-0.4905x+6.0734, with an R^{2} value of 0.9995, which is an incredibly good fit.

    Just a thought.
    Thank you. I just knew the method of least squares.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    The method of least squares can be applied to many more situations than just a linear fit, though that's probably the most common least squares. The fit I just described would be found using the same fundamental method.
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Super Member
    Joined
    Jun 2008
    Posts
    829
    Quote Originally Posted by Ackbeet View Post
    The method of least squares can be applied to many more situations than just a linear fit, though that's probably the most common least squares. The fit I just described would be found using the same fundamental method.
    Thanks
    Follow Math Help Forum on Facebook and Google+

  9. #9
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    You're welcome. Have a good one!
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Curve Fitting
    Posted in the Advanced Algebra Forum
    Replies: 11
    Last Post: November 23rd 2010, 03:55 PM
  2. Curve Fitting
    Posted in the Calculus Forum
    Replies: 8
    Last Post: September 15th 2010, 02:09 PM
  3. Fitting a curve to a form
    Posted in the Advanced Statistics Forum
    Replies: 1
    Last Post: May 12th 2009, 05:43 PM
  4. Curve fitting
    Posted in the Math Software Forum
    Replies: 7
    Last Post: November 27th 2008, 04:21 AM
  5. [Req] Curve Fitting using Excel
    Posted in the Business Math Forum
    Replies: 4
    Last Post: December 26th 2007, 12:44 PM

Search Tags


/mathhelpforum @mathhelpforum