我想画一个图,显示在最大似然拟合之后的“最佳拟合”。
在文档中的某个地方找到了这段代码
bestfit_pars = pyhf.infer.mle.fit(data, m, init_pars, par_bounds)
bestfit_cts = m.expected_data(bestfit_pars, include_auxdata = False)给出了给定拟合结果的总体预期数据。有没有办法通过样本来分解呢?理想情况下,不必手动尝试将相应的参数应用于每个样本。
另外,如果我理解正确的话:在多个通道的情况下,bestfit_cts包含所有通道的所有bin的串联。我可以在这里做一些索引讨论,但是有没有一种更直接的方法来将通道映射到bestfit_cts片段
发布于 2020-10-07 23:24:38
合并了https://github.com/scikit-hep/pyhf/pull/731之后,现在可以使用像这样的结构
# set up
bestfit_cts = m.main_model.expected_data(bestfit_pars, return_by_sample=True)
for sample_name, sample_cts in zip(m.config.samples, bestfit_cts):
passhttps://stackoverflow.com/questions/63297304
复制相似问题