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

Why do we subtract background from raw before unfolding? #196

Open
vetlewi opened this issue Nov 3, 2021 · 0 comments
Open

Why do we subtract background from raw before unfolding? #196

vetlewi opened this issue Nov 3, 2021 · 0 comments
Assignees
Labels
question Further information is requested

Comments

@vetlewi
Copy link
Collaborator

vetlewi commented Nov 3, 2021

In the Ensemble class there is the option:

  1. Provide the background subtracted gamma-excitation matrix
  2. Separate prompt and background gamma-excitation matrices.

If separate matrices are given then perturbed prompt and background matrices will be sampled separately before subtracting the background from the prompt. This background subtracted matrix is then unfolded.
In the code:

if self.bg is not None:
    prompt_w_bg = self.generate_perturbed(step, method, state="prompt+bg", rstate=rstate)
    bg = self.generate_perturbed(step, method, state="bg", rstate=rstate)
    raw = self.subtract_bg(step, prompt_w_bg, bg)
else:
    raw = self.generate_perturbed(step, method, state="raw", rstate=rstate)
unfolded = self.unfold(step, raw)

I'm wondering why the we do the background subtraction before the unfolding and not after?
In code that would be:

if self.bg is not None:
    raw = self.generate_perturbed(step, method, state="prompt+bg", rstate=rstate)
    bg = self.generate_perturbed(step, method, state="bg", rstate=rstate)
    raw_unfolded = self.unfold(step, raw)
    bg_unfolded = self.unfold(step, bg)
    unfolded = self.subtract_bg(step, raw, bg)
else:
    raw = self.generate_perturbed(step, method, state="raw", rstate=rstate)
    unfolded = self.unfold(step, raw)

I can't really see any reason why this isn't valid. I would think that this would be a convenient way around having to remove negative counts before unfolding as neither the raw nor the bg matrices will have negative counts. Maybe there is something I'm missing?

@vetlewi vetlewi added the question Further information is requested label Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants