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

Composable model #154

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft

Composable model #154

wants to merge 12 commits into from

Conversation

kdund
Copy link
Collaborator

@kdund kdund commented Apr 1, 2024

At the moment, the likelihood composability happens inside the statistical model-- but ideally we'd be able to do so also by adding together multiple statistical models as long as they're statistically independent and don't have conflicting parameter demands.

This PR draft includes a very naive start.

from alea.examples import gaussian_model
from alea.model import StatisticalModel, CompoundStatisticalModel
model_a = gaussian_model.GaussianModel()
model_b = gaussian_model.GaussianModel()

cm = CompoundStatisticalModel([model_a, model_b])

cm.data = cm.generate_data(mu=0, sigma=1)

cm.parameters.mu.nominal_value = 0.

cm.fit( sigma=1)

@coveralls
Copy link

coveralls commented Apr 1, 2024

Pull Request Test Coverage Report for Build 8823038063

Details

  • 56 of 129 (43.41%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-3.6%) to 88.367%

Changes Missing Coverage Covered Lines Changed/Added Lines %
alea/submitter.py 14 22 63.64%
alea/model.py 13 42 30.95%
alea/runner.py 29 65 44.62%
Totals Coverage Status
Change from base Build 8706621084: -3.6%
Covered Lines: 1580
Relevant Lines: 1788

💛 - Coveralls

@kdund kdund added enhancement New feature or request inference Statistics code labels Apr 2, 2024
@kdund kdund linked an issue Apr 2, 2024 that may be closed by this pull request
@kdund
Copy link
Collaborator Author

kdund commented Apr 2, 2024

Things required before review:

[] Constructor from configs
[] Per-likelihood config overrides
[] compatible with runner
[] compatible with batch submission
[] testing

@dachengx
Copy link
Collaborator

dachengx commented Apr 16, 2024

@kdund I tried to fix the error in test_init_signatures : https://github.com/XENONnT/alea/actions/runs/8706626297/job/23879636821?pr=154#step:6:201.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request inference Statistics code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow the composition of several conf files
3 participants