Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
135 views
in Technique[技术] by (71.8m points)

pyhf - Gaussian constraint in `normfactor`

I would like to understand how to impose a gaussian constraint with central value expected_yield and error expected_y_error on a normfactor modifier. I want to fit observed_data with a single sample MC_derived_sample. My goal is to extract the bu_y modifier such that the integral of MC_derived_sample scaled by bu_y is gaussian-constrained to expected_yield +/- expected_y_error.

My present attempt employs the normsys modifier as follows:

spec = {
    "channels": [
        {
            "name": "singlechannel",
            "samples": [
                {
                    "name": "constrained_template",
                    "data": MC_derived_sample*expected_yield, #expect normalisation around 1
                    "modifiers": [
                        {"name": "bu_y", "type": "normfactor", "data": None },
                        {"name": "bu_y_constr", "type": "normsys", 
                         "data": 
                                {"lo" : 1 - (expected_y_error/expected_yield), 
                                 "hi" : 1 + (expected_y_error/expected_yield)} 
                        },
                    ]
                },
            ]
        },
    ],
    "observations": [
        {
            "name": "singlechannel",
            "data": observed_data,
        }
    ],
    "measurements": [
        { 
            "name": "sig_y_extraction",
            "config": {
                "poi": "bu_y",
                "parameters": [
                    {"name":"bu_y",  "bounds": [[(1 - (5*expected_y_error/expected_yield), 1+(5*expected_y_error/expected_yield)]], "inits":[1.]}, 
                ]
            }
        }
    ],
    "version": "1.0.0"
}

My thinking is that normsys will introduce a gaussian constraint about unity on the sample scaled by expected_yield.

Please can you provide me any feedback as to whether this approach is correct, please?

In addition, suppose I wanted to include a staterror modifier for the Barlow-Beeston lite implementation, would this be the correct way of doing so?

"samples": [
                {
                    "name": "constrained_template",
                    "data": MC_derived_sample*expected_yield, #expect normalisation around 1
                    "modifiers": [
                        {"name": "BB_lite_uncty", "type": "staterror", "data": np.sqrt(MC_derived_sample)*expected_yield }, #assume poisson error and scale by central value of constraint
                        {"name": "bu_y", "type": "normfactor", "data": None },
                        {"name": "bu_y_constr", "type": "normsys", 
                         "data": 
                                {"lo" : 1 - (expected_y_error/expected_yield), 
                                 "hi" : 1 + (expected_y_error/expected_yield)} 
                        },
                    ]
                }

Thanks a lot in advance for your help,

Blaise


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...