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

Combine multiple channels into a single distribution object #27

Open
glouppe opened this issue Mar 3, 2016 · 5 comments
Open

Combine multiple channels into a single distribution object #27

glouppe opened this issue Mar 3, 2016 · 5 comments

Comments

@glouppe
Copy link
Contributor

glouppe commented Mar 3, 2016

@cranmer Can you comment on the typical use case? Or maybe just a typical RooFit example with multiple channels?

@cranmer
Copy link
Member

cranmer commented Mar 3, 2016

Example use case:

channel 1:
p(x | mu, mean_x, sigma_x, alpha) = mu*Normal(x | mean_x, sigma_x) + (1-mu) Exp(x, alpha)
and data are (x_1, ..., x_N)

channel 2:
p(y | mu, mean_y, sigma_y) = mu*Normal(y | mean_y, sigma_y) + (1-mu) Uniform(y)
and data are (y_1, ..., y_M)

"simultaneous pdf" describes both channels. Resulting likelihood is:
L(mu, mean_x, mean_y, sigma_x, sigma_y, alpha) =
\prod_{i=1}^N p(x_i | mu, mean_x, sigma_x, alpha)
x
\prod_{j=1}^M p(y_i | mu, mean_y, sigma_y)

Is that what you had in mind? Use cases basically like this but with more channels. The main issues are: observable quantity (x vs. y) and the number of events (N vs. M) is different in different channels, but there are shared parameters (eg. mu).

@glouppe
Copy link
Contributor Author

glouppe commented Mar 4, 2016

Is that what you had in mind?

Yes thanks! I need to think about this use case some more. Not sure yet how to best represent that. I'll look into RooFit RooSimultaneous.

Along the same lines, would also expect this to work for combinations of combinations of basis distributions? I.e. in a typical use case, would you reproduce this schema in a nested way?

@glouppe
Copy link
Contributor Author

glouppe commented Mar 4, 2016

At the moment, i would imagine something like this:

mu = theano.shared(0.5) # shared
px = Mixture(components=[Normal(), Exponential()], weights=[mu, 1-mu])
py = Mixture(components=[Normal(), Uniform()], weights=[mu, 1-mu])
sim = Simultaneous(components=[px, py])

At this point, parameters of sim would be the union of the parameters of px and py, with mu being automatically shared.

Then you could fit the model with sim.fit(X, Y) (providing data matrices in the same order as the components), which would jointly optimize all parameters (those of px, py and mu).

@glouppe
Copy link
Contributor Author

glouppe commented Mar 4, 2016

Then you could fit the model with sim.fit(X, Y) (providing data matrices in the same order as the components)

Hmm, but this would not work in case of nested "simultaneous" models.

@cranmer
Copy link
Member

cranmer commented Mar 4, 2016

In RooFit if you try to nest it will just re-arrange to a single level tree.
Sim(sim(a,b),sim(c,d) -> sim(a,b,c,d)

Also, RooFit uses this category variable to be an index for the mapping of
PDF to data. It allows for some flexibility... But not sure that works well
here.

Kyle
On Fri, Mar 4, 2016 at 3:16 AM Gilles Louppe [email protected]
wrote:

Then you could fit the model with sim.fit(X, Y) (providing data matrices
in the same order as the components)

Hmm, but this would not work in case of nested "simultaneous" models.


Reply to this email directly or view it on GitHub
#27 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants