I would have a general question about setting parameter limits when using the Fitter class.
Let’s say I want to fit two parameters A and B. I also want to set limits to B in such a way that the lower limit for B is the value of A at the i-th step of the fit, while the upper limit is a fixed constant value.
Up to now I could not find any hint how to implement this iteration…any hint would be welcome!
Hi,
maybe you can implement it by yourself in your function. For example, you add a line in your function with something like
So, if B takes a value that you do not want, your function returns a huge diverging value. The fit will test other values of B until the function returns a “correct” value.
thanks for the suggestion. Still the problem is that I don’t find the way to get the value of A along the fit steps…I can only get it in the end by calling the FitResult class, but it doesn’t help anymore!
In the end the question is: is there any way to get access to the fitted parameters DURING the fit, being then able to use them in order to set limits?
Is there a way to introduce a transformation on the parameters A and B in order to overcome this problem?
I mean if You have the lower limit on B being A, the new variable C=B-A will have the lower limit zero, right? The upper limit will then be const+A but You can just set it to the value You know it will never get, i.e. conts + maximum possible value of A.
I do understand that this is solution for the easiest example You provided but maybe it can help You in Your more complicated case