Skip to content
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

How to use the "up" parameter #24

Open
GoogleCodeExporter opened this issue Mar 15, 2015 · 1 comment
Open

How to use the "up" parameter #24

GoogleCodeExporter opened this issue Mar 15, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

Hello,

I'm trying to use pyminuit to minimise a Chi^2 function, and obtain errors on 
the parameters.

How do I set the "up" parameter?

do I just set it in my initial minuit object?
minbk = minuit.Minuit(x2_bk_param, tmpalphabk = 0.5, tmpvubbk = 0.0009, 
err_tmpalphabk = 0.01, err_tmpvubbk = 0.00001, up = 1)

Have read through the documentation, but can't find an explicit description of 
how to set the parameter.

Many Thanks,

Geoff

Original issue reported on code.google.com by Geoff.He...@gmail.com on 18 Feb 2011 at 10:52

@GoogleCodeExporter
Copy link
Author

Parameters of the minimizer are set as member data, like this:

>>> import minuit
>>> m = minuit.Minuit(lambda x: x**2)
>>> m.up = 1.

Keyword arguments in the constructor are interpreted as parameters of the 
objective function.  At some point, I'll look over the documentation and try to 
make that more clear.

By the way, up == 1. is the default, so you don't need to set it (chi^2 
minimization is by far the most common use-case).

You can see what it does like this:
>>> m = minuit.Minuit(lambda x: x**2)
>>> m.values
{'x': 0.0}
>>> m.up
1.0
>>> m.hesse()    # calculate the error matrix at this point (x == 0.)
>>> m.errors
{'x': 1.0}

>>> m.up = 4.
>>> m.hesse()
>>> m.errors
{'x': 2.0}

-- Jim

Original comment by jpivar...@gmail.com on 18 Feb 2011 at 9:50

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant