> >I need to fit a Gaussian function to an array of data points.
>
>What is the nature of your data? Are they just X values or X,Y pairs?
The data consists of (x, y) pairs with an associated error on y.
Ok, so you are doing what is called parametric model estimation. Your
model of
y-given-x is a gaussian with some parameters, and you want to know what
are
those parameters. The way to use the function minimizers to get those
parameters is to define a differentiable LOSS FUNCTION. This loss
function will
say for each (x,y) of data, how bad a given parameter is. You want to
find the
parameter such that the total loss over all your points is the smallest.
The problem with your initial posting was that there was no loss
function to be
seen, and none of the functions you wrote was the one to minimize!
A textbook on statistical inference can give you a better sense of what
is going
on. (check out Wasserman's "All of Statistics", or Bishop's book on
neural
networks.)
James