Gaussian fits? Sum of Gaussians?

Hi I was wondering whether there are scripts or modules around which can calculate, on a given 1D-Numarray or Numeric array, a sum of Gaussians? E.g. something like: x = sumofgaussians(input_array[, other_parameters]) where x would contain a list of arrays representing Gaussian curves, which, when added together, would result in (a good approximation of) the input_array. It would be nice, of course, if information like the standarddeviation and peak height would be associated with that data. Perhaps I am hoping for too much, but in this case you guys at least had a good laugh when reading these lines ;-) - and I'd had to write something myself or find it in other software ... Thanks a lot in advance, Christian

On Mar 7, 2005, at 9:08, Christian Meesters wrote:
I was wondering whether there are scripts or modules around which can calculate, on a given 1D-Numarray or Numeric array, a sum of Gaussians? E.g. something
That doesn't look like a well-defined problem. At the very least, you will have to provide the code with the number of Gaussians that you want to fit. But even then, unless your data has particular properties, this is likely to result in an ill-defined fit problem. While the sum of several Gaussians is not a Gaussian itself, it can look very very similar, depending on the parameter combinations. I don't think that the kind of black-box function you are looking for exists, and I think that in the long run this is good for you. There is code for the tough part of the task, nonlinear curve fitting (both in my ScientificPython library and in SciPy, with different strong and weak points). If you make the effort to formulate your problem in terms that such routines can handle, you can be reasonably sure that you have understood your problem and the solution approach, i.e. you know what you are doing. Konrad. -- --------------------------------------------------------------------- Konrad Hinsen Laboratoire Léon Brillouin, CEA Saclay, 91191 Gif-sur-Yvette Cedex, France Tel.: +33-1 69 08 79 25 Fax: +33-1 69 08 82 61 E-Mail: khinsen@cea.fr ---------------------------------------------------------------------
participants (2)
-
Christian Meesters
-
konrad.hinsen@laposte.net