Questions tagged [pyhf]

Pure Python implementation of the HistFactory statistical model for multi-bin histogram-based analysis and asymptotic interval estimation

Filter by
Sorted by
Tagged with
1 vote
0 answers
41 views

pyhf: sample distributions pdf (toys)

I am trying to generate toys from my signal like pdf constructed from the pyhf model. Following the example Running Toys by Hand here https://scikit-hep.org/pyhf/examples/notebooks/toys.html this ...
IZA__10's user avatar
  • 11
0 votes
2 answers
83 views

pyhf: Support for Variable Bin Width Histograms

I would like to obtain the expected limits for my analysis using pyhf. The previous iteration of this analysis used variable bin width histograms, and I am wondering whether pyhf can handle this ...
Rachel Hyneman's user avatar
1 vote
1 answer
41 views

2D distributions in the HistFactory?

How can I specify in the construction of the HistFactory the signal and background to be 2-dimensional distributions? I have understood than in RooStats you need to change the TH1 to a TH2. At the ...
Marchela04's user avatar
1 vote
0 answers
37 views

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 ...
bldelane's user avatar
1 vote
1 answer
77 views

pyhf test-statistics with toys

Dear pyhf creators and contributors, first of all let me thank you for taking the time to undertake this project, it has already been very useful to me in checking simple analyses and conclusions. ...
John Karkas's user avatar
1 vote
1 answer
56 views

Upper limit for n_background == 0 with pyhf

I am trying to obtain the upper limit for n_observed==0 and n_background==0 events with +pyhf*, in this case I expect to obtain 2.3 (Table 39.3 pdg-statistics PDF) I tried to create the workspace with ...
Marchela04's user avatar
1 vote
1 answer
129 views

Using `pyhf` to float both signal and background strength

Hi pyhf users and developers! I have a question that follows from a previous question and so I'll start with the anwser.py code provided in one of the responses and thena minor modification. So I run ...
Matt Bellis's user avatar
1 vote
2 answers
236 views

Trying to put together a teaching-example with pyhf

I'm trying to learn more about pyhf and my understanding of what the goals are might be limited. I would love to fit my HEP data outside of ROOT, but I could be imposing expectations on pyhf which are ...
Matt Bellis's user avatar
1 vote
0 answers
63 views

Nuisance parameters which are related between channels

I want to do a combined fit, where the normalization of a background is related between two channels (regions in my case) using an ABCD formula. I've been using a standard normfactor so far to vary ...
paulgessinger's user avatar
1 vote
1 answer
51 views

Expected data split by sample

I want to make a plot that shows the 'best fit' after an maximum likelihood fit. This snippet found somewhere in the docs bestfit_pars = pyhf.infer.mle.fit(data, m, init_pars, par_bounds) bestfit_cts ...
paulgessinger's user avatar
2 votes
1 answer
199 views

pyhf: implementation of statistical uncertainty

I have a question regarding the implementation of the statistical uncertainty. In the pyhf documentation https://scikit-hep.org/pyhf/likelihood.html#sample you mention that the way to infer ...
Sally's user avatar
  • 23
1 vote
1 answer
98 views

pyhf: POI application using formula

I am trying to write a likelihood model in which the POI affects two samples, but while one I have the regular POI*yield, the other I have f(POI)*yield where f is an arbitrary function. Is there a ...
Rafael's user avatar
  • 113
3 votes
2 answers
354 views

Minimal pyhf example failing with 'Inequality constraints incompatible'

I am trying to build a pretty minimal pyhf example: two gaussians, one signal and one background, but I can't get it to work. My python code is: import pyhf.readxml import os from ROOT import TH1F, ...
robsol90's user avatar
  • 113
1 vote
1 answer
289 views

Fit convergence failure in pyhf for small signal model

(This is a question that we (the pyhf dev team) recently got and thought was good and worth sharing. So we're posting a modified version of it here.) I am trying to do a simple hypothesis test with ...
Matthew Feickert's user avatar