# Calculating confidence interval of a combination of variables of different distributions?

Once or twice a year, we go through an elaborate and expensive process to measure leakage in a pipe. We calculate leakage via mass balance, so that:

$$Leak = X + Y - Z$$

Depending on how well data was collected for each variable, we select particular assumptions. For example, we might assume Z to be uniformly distributed, while X & Y are normally distributed.

The end goal is to calculate the confidence interval of the estimated leak.

After calculating $\hat{\mu}$ and $\hat{\sigma}$ for each variable, it's tempting to assume that $Leak$ is normally distributed, just because deriving the confidence interval is straight forward. I just need to calculate $t_{\alpha/2}$, and define the confidence interval as $\mu_{Leak} \pm t_{\alpha/2}\hat{\sigma}_{Leak}$. But this a pretty bad assumption, as $Leak$ is not normally distributed because $Z$ is uniformly distributed. Any clues on how to calculate this confidence interval?

# Update:

I used simulation, as @soakey suggested, to generate 10k-sized samples for each historical event, and calculating the confidence interval was a matter of calculating the $(\alpha/2)^{th}$ and the $(1-\alpha/2)^{th}$ percentiles.

• Is there anything preventing you from simulating? Nov 18, 2013 at 21:39
• Re (1): It is impossible for a uniform variate and a normal variate to have a correlation of $1$.
– whuber
Nov 18, 2013 at 21:42
• Thanks for your comment @whuber. You made me realize a flaw in my analysis. I thought Y and Z should have been correlated because if we close the valve affecting Y, flow will change proportionally in Z. But this is a mistake, because one of the conditions for my measurement is that no changes should be done to the state of system during data collection. I think I can safely consider them independent. Nov 18, 2013 at 23:14
• @soakey, thanks for the idea! I can probably just simulate the three variables jointly and estimate the pdf. I will give it a try. Nov 18, 2013 at 23:18
• You should modify your question to reflect your new understanding. [Note for future reference, however, that 'what doesn't go through Z must go through Y' would tend to imply negative, not positive correlation -- since the statement implies they must add to a constant, the present flow] Nov 19, 2013 at 1:05