Exponential fit

Hello everybody,
I am trying to fit some data, which follows a distribution in the form
[ I = I_0 \exp(-(t-t_0)/\tau) ]
but I experience two problems (I am using the interpreter with the FitPanel, at this stage):

  • using renormalized data (see below), after defining
    TF1 *myfunc = new TF1(“myExp”, “[0]*TMath::Exp((x - [2])/[1]”);
    the fit does not converge, but if I put *[1] instead of /[1] it does; is this an issue related to the minimization?

  • if I do NOT manually renormalize data (which is actually what I do not want to do) to some couple (t, I), the fit never converges; if I try to manually initialize the [0], [2] parameters to those of that (t, I) couple, I simply get an horizontal line without any meaning.

Thank you in advance.

Not sure what to tell without seeing the data and actually trying to fit myself, but in general:

An user defined function such as yours converges ONLY if you set good initial parameters. This is strictly due to minimization algorithms. And don’t get me started on why and how. Just precompute initial parameters close enough somehow. For example, first make a fit with ROOT defined “expo” ( for which precomputing of initial parameters is done for you automatically), then extract parameters, plug them into your function as initial parameters and refit. Works for me all the time when I make up some funny functions on some even funnier data :slight_smile:.

you have probably to supply initial parameter values which are not too far away from the fit result. This could explain the difference observed when using *[1] or /[1] or normalized/un-normalized data.

If this does not solve your problem, I would need your data points in order to reproduce it.

Best Regards


Obviously I tried estimating the fit parameters before fitting, but it does not work.
I will try to get some data from the big sample and attach it to you.

Additionally, when I put these initial estimates in the FitPanel parameters input boxes, even if I fix or bound them this seems not to work.