Comments (5)
Apparently it worked up to the commit 74a8f1c (Wed Feb 22 16:33:26).
from spey.
Hi @APMDSLHC, I did some major changes in the code structure which fixed the issue on my end but please do all your checks again because these changes are big. So you can modify your code as follows
statModel = spey.get_multi_region_statistical_model("test", patch, bkg)
config = statModel.backend.model.config()
bounds = config.suggested_bounds
bounds[config.poi_index] = (config.minimum_poi, 100)
mu_ul_spey = statModel.poi_upper_limit(
expected=spey.ExpectationType.observed, allow_negative_signal=False, par_bounds=bounds
)
print("muUL:", mu_ul_spey)
# Out: muUL: 38.38686452333036
Note that from now on, it won't do the adaptive bound adjusting; it seems like that is the thing that was giving you weird results. If you check the CLs distribution with respect to POI in the previous commit, the distribution has a discontinuity which caused by this adaptive bound rescaling. So I think we might need to come up with smarter ways to do the bound adjustment.
Please let me know if you find anything related to this.
from spey.
Thanks for the fixes.
Now I have an error when calling poi_upper_limit
with SL backend:
File "/home/pascal/SModelS/spey/src/spey/optimizer/core.py", line 21, in fit
print("model_configuration.fixed_poi_bounds():",model_configuration.fixed_poi_bounds())
AttributeError: 'list' object has no attribute 'fixed_poi_bounds'
The problem seems to arise because model_configuration
is a list of zeros.
Tell me if it's not a straightforward fix, I'll share you my code.
from spey.
Thanks @APMDSLHC, I totally missed this one, I updated the necessary bits. It works on my side now:
stat_model_sl = spey.get_multi_region_statistical_model(
"simple_sl_test",
signal=[12.0, 11.0],
observed=[51.0, 48.0],
covariance=[[3.,0.5], [0.6,7.]],
nb=[50.0, 52.0],
delta_sys=0.,
third_moment=[0.2, 0.1],
xsection=0.5
)
print(stat_model_sl.poi_upper_limit())
# Out: 0.8704245319083141
from spey.
Thank you, it works well now, I am closing the issue.
from spey.
Related Issues (18)
- Can't find the likelihood maximum HOT 6
- maxiter HOT 2
- SL issue HOT 4
- third_momenta HOT 1
- Enable computation of p-values from chi-square CDF
- Error in ```UnCorrStatisticsCombiner```
- Numpy version dependency HOT 7
- Strong machine dependence of spey results (simplified likelihoods) HOT 11
- optimiser argument ntrial > 1 crashes HOT 1
- How to improve the exclusion limit calculation? HOT 5
- Differences between SModelS and MadStats upper limit on mu with pyhf backend HOT 2
- Inconsistent results with signal uncertainties
- The minima of the Asimov negloglikelihood is not centralised at `poi_test = 0` HOT 1
- Python 3.12 compatibility issue HOT 2
- Error when computing likelihood from uncorrelated model with an absurdly high number of observed yields. HOT 6
- Loss in numeric stability
- division by zero HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spey.