-
Notifications
You must be signed in to change notification settings - Fork 57
Overriding parameter ranges after PDF has been built #621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You can actually do that! However, I would not, in general, do this. The limits should not really matter. A limit is just there to say that if the value is close to it, it's completely wrong. It's a "if you're here, everything is invalid" limit. Ideally, the limits should be far away from the expected value and the fits should also work fine without any limits. They just help to give an approximate idea (i.e., is the value more between -10, 10 (for a lambda of an exp, or more 5000 - 6000 (for a value of the B mass). You can also set the Did you see any issues? Or anything? The model factory kinda makes sense. In general, it's better to recreate PDFs than to manipulate existing ones (because of caching and jit), so having a "factory function" (or any other factory) makes a lot of sense! |
Limits are optional for parameters? I did not know that.
Oh, I did not know about the stepsize. So the only thing that the fitting framework actually needs is the value and the parameter.
I just needed more flexibility to adapt my fitting models to other fits. I just made a small class to do this. This class should talk to a database and get in the way, injecting a custom range. But maybe just not passing any range and letting the fitter figure it out is better. On the other hand, at least the value should be around the right number. If you have a peak at 10 in your model but the data has it at 100, then when you evaluate the likelihood you are sampling the tail, where the PDF is basically zero. That would give you NaNs and even with modern computer's precision, I think that tail would drop so fast that you would just get a NaN. So, some fancier algorithm or setting numbers by hand will be needed at the end.
Yeah, to me (and I assume most users) what matters the most is that I spend less time typing stuff and that my code be as small and simple as possible. |
Yes, there is no real reason for them to be there, albeit it's often good to have a dead zone
Yes, the minimizer needs an initial value and an "initial step size". That's basically it.
I would even go further: this is the crucial element. The minimizers are local minimizers, they start at the point and go downhill basically until they find a minimium. That's it, no magic or anything. So yes, make sure to start "close enough" (but not on point)
Agree! |
Is your feature request related to a problem? Please describe.
When we build models, we need a lot of code to get a sum of crystall balls, or gaussians, etc. One way to go around this is to make a model factory like the one here. This allows:
However once the model is built we seem to be unable to do something like:
In my particular case, the
ModelFactory
builds models for fitting B meson masses. However I would like to adapt it quickly to fit Jpsi masses.Describe the solution you'd like
I wonder if a method to override the already built parameter range can be implemented, like:
Describe alternatives you've considered
In the model factory I could do:
i.e. introduce my parameter instead of allowing the factory to build that parameter.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: