As long as you can express a function, , to be minimized with respect to a set of parameters , then the GSL can fit data using several methods. The function is usually given by
where are the set of data points and errors in , and for a single point , and paramter set , the user-supplied model function returns a single value .
gsl_fit_containerstruct contains three other structs, each of which contain the data, the parameters and the model functions, respectivly.
This becomes useful, for example, when the data is a sum of gaussian peaks. Instead of putting all the peaks into one function call, you can write a single general function that evaluates a single gaussian function and call the function
gsl_fit_add_model_* as many times as you need.
In these cases, it becomes necessary that when the program calls the user-supplied function for evaluating , additional paramters are passed which indicate which data set and which peak are being calculated.
To use this feature, as you add data sets, they are numbered as you add them, starting from 0. Likewise, as you add functions, they are numbered as you add them.
For more information on these, see the GSL documentation. It may be possible to add optional GSL extension minimization routines.
All comments and questions are welcome, see my main page for my email address. Feel free to browse these documentation pages.