+ Reply to Thread
Results 1 to 2 of 2

gaussian fitting to histogram

Hybrid View

excelaitin gaussian fitting to histogram 10-14-2020, 04:09 PM
MrShorty Re: gaussian fitting to... 10-16-2020, 10:24 AM
  1. #1
    Registered User
    Join Date
    10-14-2020
    Location
    USA
    MS-Off Ver
    2002
    Posts
    1

    gaussian fitting to histogram

    Dear All,

    I am trying to fit guassian function to a histogram whose x axis is logarithm base 10. I have attached a image in the excel sheet how I expect it to look, however, I cannot obtain anything like that. I don't know what I am doing wrong. I will appreciate if somebody can explain me where I went wrong.

    Thank you.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,563

    Re: gaussian fitting to histogram

    tl:dr -- it appears to me that you do not have a correct Gaussian function in column C. I expect that most of the solution is to get a correct Gaussian function in column C.

    You say that you are trying to fit to a Gaussian function, but your formula in column 3 is a parabola y=a*(-(x-b)^2/2/c). Wikipedia (https://en.wikipedia.org/wiki/Gaussian_function ) notes that a Gaussian function is one with the general form y=a*exp(-(x-b)^2/2/c^2). It looks like you neglected to include the exp() function in column C.

    Then, as noted, your x axis is really a logarithmic axis, so you need to substitute log(x) for x in the Gaussian function y=a*exp(-(log(x)-b)^2/2/c^2). I make that correction to column C.

    Then, I want to see what my fit looks like, so I select your XY scatter chart and expand the source data range to include column C. Now I can see both the original data and my best fit curve.

    I want to enter some reasonable guesses for a, b, and c. Wikipedia notes that a is the height of the peak, which looks like it should be 2500, so I enter 2500 for a. Wikipedia notes that b marks the horizontal position of the top of the peak, which looks like it should be at log(1E-5), so I enter -5 for b. I can see that 1 looks like a good guess for c, so I leave c unchanged.

    If I want to further optimize the fit, I come up with a suitable objective function for my curve fit (least squares or rmsd or whatever I deem appropriate), the call Solver and tell it to optimize the objective function by changing a, b, and c.

    Does that help?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 03-20-2019, 02:53 PM
  2. Gaussian Fit
    By Harif in forum Excel General
    Replies: 1
    Last Post: 06-27-2012, 11:29 AM
  3. how to draw Gaussian shape with histogram
    By baouche in forum Excel General
    Replies: 1
    Last Post: 03-04-2011, 08:00 AM
  4. Gaussian Elimination
    By cjrrussell in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 09-24-2006, 05:21 AM
  5. I was creating a histogram; now i have data but no histogram.
    By ShannonMills3 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-13-2006, 07:10 PM
  6. [SOLVED] How to Histogram w/o raw data but histogram Table on Excel
    By 2005 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-01-2006, 02:50 AM
  7. How can I add a Gaussian curve to a histogram on Excel?
    By JC1379 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 09-21-2005, 04:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1