4.0

4.0 | 4 ratings Rate this file 121 Downloads (last 30 days) File Size: 2.15 KB File ID: #35122
image thumbnail

Gaussian fit

by Przemyslaw Baranski

 

16 Feb 2012 (Updated 23 Feb 2012)

Fits Gaussian curve into points. The curve is understood as a probability density function, pdf.

| Watch this File

File Information
Description

The function fits Guassian probability density function into a set of points. Standard deviation and mean are returned.

Required Products MATLAB
MATLAB release MATLAB 7.5 (R2007b)
Tags for This File  
Everyone's Tags
gauss fit, gauss interpolation, gaussian fit(2), guassian interpolation(2), normal fit, pdf fit(2), pdf gauss fit
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (6)
24 Oct 2012 sr

My data has a constant (with some spread) y-offset. Please let me know what to do in your code to make it fit? Thanks

24 Oct 2012 sr

My data has a constant (with some spread) y-offset. Please let me know what to do in your code to make it fit? Thanks

29 Mar 2012 Eddie  
23 Feb 2012 Thijs

Updating my previous comment for future readers.

The problem was indeed incorrectly scaled data. The function works quite beautifully now.

22 Feb 2012 Przemyslaw Baranski

Hi Thijs. Is your data properly scaled? I mean a probability density function should sum up to 1 and so should roughly the histogram for which your try to fit the curve

22 Feb 2012 Thijs

I changed the line 88 from exit to return.

The function works rather poorly on my data though, I get better results minimizing the logarithmic residuals.

Updates
19 Feb 2012

More description, so that it can perhaps be easier found

23 Feb 2012

Normalization of data. Added some infos to the helpd section

23 Feb 2012

Checking if the input points (x,y) are sorted. If not sort them. Improved checking if p.d.f sums up to 1

Contact us