Your function f has no free parameters to fit/play around with! What do you think that fitting a function to a set of data points is doing? You may benefit from reading the help about genfit and looking at the quicksheets.
BTW, are you sure about your function f? See below what it looks like simplified with the values you provided.
One other thing - get rid of the index i in timescan. The way you wrote it you create a vector with 203 elements, all af which are zero and only timescan[202 consists of a vector which contains the data you are interested in. Just delete all i (three times) in your sheet.
I am sure about the function and I have even used the simplify form, but I am not able to fit data using this function. Even if I delete i, I can't fit the data.
I often used genfit but now I am blocked.Here is the file with the simplify form.
I am sure about the function and I have even used the simplify form, but I am not able to fit data using this function. Even if I delete i, I can't fit the data.
I often used genfit but now I am blocked.Here is the file with the simplify form.
As already written in another post in this thread, deleting i helps uncluttering the mess with vector time but has nothing to do with genfit.
In your sheet you ask why our symbolically simplified euqations look different. Thats because you used simplify (which is a good idea anyway) and I did not. The simplification has again nothing to do with genfit, it simply helped to show that your function had not a single parameter to adjust and therefore genfit had to fail.
It seems you do good in being sure about your function, as it produces a not so bad fit.
Nevertheless I could image that a least square fit using three or four Gaussians would do a better job. If I remember right Richard had shown and explained to you in a thread a few months ago how to do.
But now, to help you remember about how to use genfit find attached the solution using genfit.
You will have to show which variables are the independent and which variables are the dependent. Also, you will have to specify which parameters you are going to adjust.
I adjust with ag0 and ag1 as you can see in the file.
No! Thats absolutely not to be seen in your file!
If ag0 and ag1 are the parameters to adjust, the fit function has to be written to be dependent of them (either singly as a list or as a vector). Then you would have to provide the guess values for your parameters when calling genfit.
You didn't show your attempt to call genfit in the sheet anyway.
My remark about i has nothing to do with genfit, I was trying to help you understanding what you are doing with your vectors. It didn't made much sense.