Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repeated staterror across channels #2565

Open
1 task done
andrewfowlie opened this issue Dec 13, 2024 · 0 comments
Open
1 task done

repeated staterror across channels #2565

andrewfowlie opened this issue Dec 13, 2024 · 0 comments
Labels
bug Something isn't working needs-triage Needs a maintainer to categorize and assign

Comments

@andrewfowlie
Copy link

Summary

I expected that staterror modifiers with the same name, across different channels, would be treated as correlated. Instead, the second staterror modifier parameters get appended to the first lot.

This isn't what I expected to happen. Not sure if it is a bug or not.

OS / Environment

NAME="Fedora Linux"
VERSION="40 (Forty)"
ID=fedora
VERSION_ID=40
VERSION_CODENAME=""
PLATFORM_ID="platform:f40"
PRETTY_NAME="Fedora Linux 40 (Forty)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:40"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f40/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=40
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=40
SUPPORT_END=2025-05-13

Steps to Reproduce

bug.json

{
    "channels": [
        { "name": "firstchannel",
          "samples": [
            { "name": "signal",
              "data": [5.0, 10.0],
              "modifiers": [
                { "name": "k_staterror", "type": "staterror", "data": [0.1, 0.2] },
                { "name": "lumi", "type": "lumi", "data": null }
              ]
            }
          ]
        },
        { "name": "secondchannel",
          "samples": [
            { "name": "signal",
              "data": [5.0, 10.0],
              "modifiers": [
                { "name": "k_staterror", "type": "staterror", "data": [0.1, 0.2] },
                { "name": "lumi", "type": "lumi", "data": null }
              ]
            }
          ]
        }
    ],
    "observations": [
        { "name": "firstchannel", "data": [50.0, 60.0] }, { "name": "secondchannel", "data": [50.0, 60.0] }
    ],
    "measurements": [
        { "name": "Measurement", "config":
          {"poi": "lumi", "parameters": [ 
            { "name": "lumi", "auxdata": [1.0], "sigmas": [0.017], "inits": [1.0] }
          ]
          }
        }
    ],
    "version": "1.0.0"
}

Reproducer

import pyhf
import json

with open("bug.json") as f:
    spec = json.load(f)
    
ws = pyhf.Workspace(spec)
model = ws.model()

print(model.config.par_names)

Output:

['lumi', 'k_staterror[0]', 'k_staterror[1]', 'k_staterror[2]', 'k_staterror[3]']

File Upload (optional)

No response

Expected Results

I expected to have 2 k_staterror parameters (one for each bin) that were correlated across the two channels

['lumi', 'k_staterror[0]', 'k_staterror[1]']

Actual Results

['lumi', 'k_staterror[0]', 'k_staterror[1]', 'k_staterror[2]', 'k_staterror[3]']

The second k_staterror gets appended to the first, giving 4 k_staterror parameters in total.



### pyhf Version

```console
pyhf, version 0.7.6

Code of Conduct

  • I agree to follow the Code of Conduct
@andrewfowlie andrewfowlie added bug Something isn't working needs-triage Needs a maintainer to categorize and assign labels Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Needs a maintainer to categorize and assign
Projects
None yet
Development

No branches or pull requests

1 participant