关于统计不确定性的实施,我有一个问题。在pyhf文档https://scikit-hep.org/pyhf/likelihood.html#sample中,您提到了推断统计不确定性的方法是使用带有"type":"staterror“和data field=0.1的修饰符。
所以让我们假设我有一个来自MC的背景频道,我把我的发行分成三个回收箱:
"name": "background",
"data": [300., 50., 60.]你如何正确地解释统计不确定性?从Poissonian的构建,我想说,通过建设,你已经考虑了统计的不确定性。还是我必须有一个包含状态错误的修饰符?统计错误的数据字段到底是什么?
发布于 2020-08-06 04:48:05
I有一个来自MC的背景频道
考虑到由于Monte样本大小有限,您想要对形状的不确定性进行建模,最好使用的修改器是staterror。staterror在所有样本(有一个staterror修饰符)之间共享,它是在正常约束下应用的,约束的强度是在正交中添加的每个样本的不确定性。在这里,data键表示样本中每个桶中的绝对不确定性(在本例中是bin计数的泊松不确定性):
因此,考虑到一个带有3个回收箱的单个背景示例,示例规范可能如下所示(我将命名为bkg_only_spec.json)。
{
"channels": [
{
"name": "single_channel",
"samples": [
{
"name": "background",
"data": [
300.0,
50.0,
60.0
],
"modifiers": [
{
"name": "uncorr_bkguncrt",
"type": "staterror",
"data": [
17.32051,
7.07107,
7.74597
]
}
]
}
]
}
],
"observations": [
{
"name": "single_channel",
"data": [
300.0,
50.0,
60.0
]
}
],
"measurements": [
{
"name": "Measurement",
"config": {
"poi": "mu",
"parameters": []
}
}
],
"version": "1.0.0"
}我们可以看到(注意,constrained_by_normal)仍然是CLI's inspect的一个有效规范(当然,您也需要一个信号样本来进行任何推断)
$ pyhf --version
pyhf, version 0.5.1
$ python answer.py
$ pyhf inspect bkg_only_spec.json
Summary
------------------
channels 1
samples 1
parameters 1
modifiers 1
channels nbins
---------- -----
single_channel 3
samples
----------
background
parameters constraint modifiers
---------- ---------- ----------
uncorr_bkguncrt constrained_by_normal staterror
measurement poi parameters
---------- ---------- ----------
(*) Measurement mu (none)下面的answer.py生成规范。
# answer.py
import numpy as np
import json
def main():
bins = [300.0, 50.0, 60.0]
# rounding, as keeping full floating point is maybe a bit silly
poisson_uncert = np.sqrt(bins).round(decimals=5).tolist()
# just set the observations to be the same as the bin count here
# as a placeholder
spec = {
"channels": [
{
"name": "single_channel",
"samples": [
{
"name": "background",
"data": bins,
"modifiers": [
{
"name": "uncorr_bkguncrt",
"type": "staterror",
"data": poisson_uncert,
}
],
}
],
}
],
"observations": [{"name": "single_channel", "data": bins}],
"measurements": [
{"name": "Measurement", "config": {"poi": "mu", "parameters": []}}
],
"version": "1.0.0",
}
with open("bkg_only_spec.json", "w") as spec_file:
json.dump(spec, spec_file, indent=4)
if __name__ == "__main__":
main()https://stackoverflow.com/questions/63251753
复制相似问题