Skip to content

Improving the API, how to implement constraints and extended likelihood #24

@maxnoe

Description

@maxnoe

Constraints

These are nothing special i suppose, we just need an operator to join likelihoods with different data sizes.
I think the logical approach for the end user for a constraint would be something like this:

# unconstraint model for the data
x = var("x")
mu = par("mu")
sigma = par("sigma")
model = Normal(x,  mu, sigma)

# constraint to mu from other experiment:
mu_meas = var("mu_con")
sigma_meas = var("sigma_con")
constraint = Normal(mu_meas, mu, sigma_meas)

# join the models:
const_model = Join(model, constraint)

And then fit as usual

Extended Likelihood

It should be as simple as this from the user point of view:

x = var("x")
mu = par("mu")
sigma = par("sigma")
signal_model = Normal(x, mu, sigma)

tau = par("tau")
background_model = Exponential(tau)

N1 = par("N_sig")
N2 = par("N_bkg")

model = Join(N1, signal_model, N2, background_model)

Maybe we can implement the Extended likelihood over a parameter attribute? LIke
N1 = par("N1", num_events=True) would trigger an extended Likelihood?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions