
From:  Max Belushkin 
Subject:  Re: [Helpgsl] subscribe 
Date:  Tue, 06 Dec 2005 20:40:14 +0100 
Useragent:  Thunderbird 1.5 (X11/20051025) 
Actually, on second thought, this might work, perhaps?You can numerically compute your f(x,p1,p2,...). You have a bin of values you're fitting to  f_x1, f_x2, ..., f_xN (i.e. samples of another function at some points).
If you take a function to minimize as sum_{1}^{N} (f(x_i,p1,p2,...)f_xi)^2, you have a function C(p1,p2,...).
Now, if THAT is smooth as a function of p1, p2, ..., pm, you can easily compute derivatives of it in p1, p2, ..., pm numerically using GSL, so you don't need any explicit knowledge about your histogram functions' derivatives.
Or did I misunderstand something else? Max Belushkin wrote:
Ah, I see. Well, unless there's some clever way of numerically computing the gradient of that, I'd go with James' suggestion and use a simplex method...address@hidden wrote:My model function is attached in a dvi file to this email. I am completelynot sure what do you mean by (.... the actual function you're "fitting" doesn't matter, since chi squared is a sum over the whole range(s) of the squares of the function values minus the data bin (i.e. experimental data)....). Can you clarify,please? Any library that I try to use invloves derivatives, abut I don't know the derivatives of my histogram par of the functiont?! Thank you for your response. HassanI'm not sure I understand what you're trying to do 100%, but, generally, for any regression, you choose a function to minimize  i.e. chi squared. That takes some parameters over which you're minimizing, and, if one is lucky, is continuous in those parameters  then you need to take the derivatives in parameters, the actual function you're "fitting" doesn't matter, since chi squared is a sum over the whole range(s) of the squares of the function values minus the data bin (i.e. experimental data). Well, I lost the experimental errors in there. So, how are you composing your function to be minimized? Is it somehow discretized in terms of the parameters? I think a bit more information on how you're trying to get to the end result would be helpful. address@hidden wrote:Hello, I was looking for a nonlinear fitting algorithm, and the manual onlycovers Algorithms with Derivatives, but unfortunatly this does not applyfor code as I have a histogram convolved with a Gaussian as my fitting function. Is there any Algorithm without Derivatives that I may use inGSL, and if not what other software that maight be helpful, knowing thatI only program in C. Thank you in advance for your response. Sincerely, Hassan  Hassan Saadaoui, PhD candidate, TRIUMF 4004 Wesbrook Mall Vancouver, B.C. Canada V6T 2A3 16042221047, ext. 6194  _______________________________________________ Helpgsl mailing list address@hidden http://lists.gnu.org/mailman/listinfo/helpgslSincerely, Hassan  Hassan Saadaoui TRIUMF 4004 Wesbrook Mall Vancouver, B.C. Canada V6T 2A3 16042221047, ext. 6194 _______________________________________________ Helpgsl mailing list address@hidden http://lists.gnu.org/mailman/listinfo/helpgsl
[Prev in Thread]  Current Thread  [Next in Thread] 