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

Add column to toyMC results with minuit convergence flag #91

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

kdund
Copy link
Collaborator

@kdund kdund commented Sep 27, 2023

This PR adds the minuit convergence flag to the results.
Closes #90

Example to check:

from alea.utils import load_yaml
from alea.runner import Runner
import numpy as np

runners = dict()
for fittable_sigma in [False, True]:
    runner = Runner(
        statistical_model = "alea.examples.gaussian_model.GaussianModel",
        poi = "mu",
        hypotheses = ["free","zero","true"],
        n_mc = 100,
        nominal_values = {"sigma":1.0},
        generate_values = {"mu":1.0},
        parameter_definition= {
        "mu": {
            "fit_guess": 0.0,
            "fittable": True,
            "nominal_value": 0.0,
            "parameter_interval_bounds": [
                -10,
                10,
            ],
        },
        "sigma": {
            "fittable": fittable_sigma,
            "nominal_value": 1.0,
            "fit_limits": [0,np.inf],
        },
    },
    output_filename = "test_sigmafree_{:d}.hdf".format(int(fittable_sigma))
    )
    runner.run()
    
    

for sigma_free in [False, True]:
    run_results = ii.toyfiles_to_numpy("test_sigmafree_{:d}.hdf".format(int(sigma_free)))
    print([np.mean(run_results[k]["valid_fit"]) for k in ["free","zero","true"]]) #the second, only 0.25 of fits converge or so

@kdund kdund changed the title Add column to with minuit convergence flag Add column to toyMC results with minuit convergence flag Sep 27, 2023
Copy link
Collaborator

@dachengx dachengx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks cool. Thanks @kdund .

@kdund kdund merged commit 893b528 into main Sep 29, 2023
@kdund kdund deleted the fit_quality_flag branch September 29, 2023 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should fit failures be tagged/ warnings thrown etc?
2 participants