By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,089 Members | 2,418 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,089 IT Pros & Developers. It's quick & easy.

How to make a Gaussian Fit?

P: n/a
Anyone knows how to make a Gaussian fit to a histogram data using Python, or
where I can find a library that helps me in this task?

Tks everyone...

Paxcal
Jul 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a

"Xcal" <pa******@sapo.pt> wrote in message
news:40***********************@news.telepac.pt...
Anyone knows how to make a Gaussian fit to a histogram data using Python, or where I can find a library that helps me in this task?


The standard way to fit Guassian distributions to data is to match mean and
standard deviation. Take a look in some statistics texts.

TJR


Jul 18 '05 #2

P: n/a
Xcal wrote:
Anyone knows how to make a Gaussian fit to a histogram data using Python,
or where I can find a library that helps me in this task?

Tks everyone...

Paxcal


Install the Numeric module, then
import MLab
a = range(10)
mean = MLab.mean(a) 4.5 standard_deviation = MLab.std(a)

3.0276503540974917

Carl
Jul 18 '05 #3

P: n/a
Xcal wrote:
Anyone knows how to make a Gaussian fit [...]


Put it on a mean exercise program and don't allow any deviation.
Jul 18 '05 #4

P: n/a
"Xcal" <pa******@sapo.pt> wrote in message news:<40***********************@news.telepac.pt>.. .
Anyone knows how to make a Gaussian fit to a histogram data using Python, or
where I can find a library that helps me in this task?


This is a special case of non-linear fitting, which you can do with
the modules in ScientificPython. See
http://starship.python.net/~hinsen/ScientificPython/

Here is an extract from the relevant docs...

-----------------------------------------------------------------------
Module Scientific.Functions.LeastSquares
Functions

* leastSquaresFit()

General non-linear least-squares fit using the
Levenberg-Marquardt algorithm and automatic derivatives.
....
-----------------------------------------------------------------------

Cheers

Will
Jul 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.