I have histograms produced from two sets of data recording. One of background noise of values $X$ and another $Z$ with a signal of values $Y$ present such that $Z = X + Y$.
How can I estimate a histogram of the distribution of $Y$ given that I can only record $X$ and $Z$?
$X$ and $Z$ are not recorded simultaneously, so the samples taken of $X$ in $Z$ may not be precisely the same.
I learned that if I had $X$ and $Y$ already, I could convolve the histograms to produce $Z = X + Y$ predictably using the convolution theorem to calculate $Z_{hist} = f(\hat{f}(X_{hist}) * \hat{f}(Y_{hist}))$ in a pointwise manner, where $\hat{f}$ and $f$ are the Fourier and inverser Fourier transforms respectfully. I inverted this to produce $Y_{hist} = f(\hat{f}(Z_{hist}) / \hat{f}(X_{hist}))$ and found it worked when the data sampled from X was exactly the same as summed into Z, but when the data is sampled separately the resulting histogram has negative bin counts and a non-integer sum.
Is there a better way than the convolution theorem, or a way to massage the data to produce a workable answer?
An example of the situation might be as follows.
- Simulate arbitrary, differing distributions $X$ and $Y$.
- Produce $n$ samples of $X$ and store a histogram $X_{hist}$.
- Produce $m$ pairs of samples from $X$ and $Y$ and sum them, calling it $Z = X + Y$. Store these sums into a histogram $Z_{hist}$.
- I would like to produce an approximate histogram $Y_{hist}$ using only $X_{hist}$ and $Z_{hist}$ and the knowledge that $Z_{hist}$ was generated by $Z = X + Y$. I am trying to estimate the distribution of $Y$.