# How to perform linear regression when each data item is itself a distribution?

I have two sets of data $$R$$ and $$R^{'}$$, and I would like to perform regression to infer whether for some function $$f$$ (which I postulate) and some data item $$E$$ (representing noise), there exists a relationship $$R' = f(R,E)$$.

Initially I thought I would try some linear function such as $$f(R,E) = \alpha R + \beta E = R^{'}$$ - clearly a task for linear regression. However, my problem is that each data item in both $$R$$ and $$R^{'}$$ is itself a distribution rather than just single values for $$R$$ and $$R^{'}$$, i.e. a tuple of values - specifically these are quantum mechanical measurements of qubit states, where we are performing measurements on a given state vector and count the measurement outcomes, which are either 1s or 0s for a given qubit. For example, when measuring a 2 qubit state we can get (0,0), (1,0), (0,1), or (1,1), and we would thus then have a tuple with 4 elements in, where the values represent either the raw number of counts of each state, or estimates of the probabilities when normalised by the total number of samples.

I was wondering therefore whether it's still possible to carry out regression in this case? Or does this require some feature engineering beforehand in order to convert these distributions into metrics which are single valued?

• A tuple does not automatically imply a distribution, so you are likely making some undisclosed assumption by treating it as one. Can each tuple perhaps be considered a sample from a corresponding random variable? Commented Mar 29, 2022 at 15:39
• Hi @RichardHardy, thanks for answering. Yes, I am indeed making some undisclosed assumptions, apologies. Each tuple is actually a discrete probability distribution, where each element represents a probability for a specific outcome. Accordingly element one for a given set of tuples in both $R$ and $R^{'}$ represent the corresponding probabilities for that particular outcome within those datasets etc. So yes, the tuples can essentially be considered as the number of counts when sampling from a (discrete) random variable. Commented Mar 29, 2022 at 15:59
• How do you obtain these probabilities? If they are counts or proportions, then they are not probabilities. The distinction is important.
– whuber
Commented Mar 29, 2022 at 16:43
• You need to give more details&context, maybe an example of what the data looks like.. But loke into functional regression! Search this site. Commented Mar 29, 2022 at 16:59
• The variance of a count is the count itself; thus, counts around $20$ have sampling errors of $\sqrt{20}\approx 4.5.$ That is an appreciable proportion of $20.$ I would say you need to be concerned about these sampling errors and should at least explore the merits of errors-in-variables regression methods. You should also be using a multivariate Poisson generalized linear model (GLM) for the response if you can.
– whuber
Commented Mar 30, 2022 at 14:28