Firstly, I do not have statistics background other than a single lesson I took more than a decade ago, so I will use incorrect terms to explain my question. And probably it is one of the reasons that I cannot find any answers in existing questions. (Or did not understand the answers because they are full of jargon)
I want to find/build an algorithm to perform basic arithmetic operations on multiple random variables (or maybe I should say distributions). But the result should also be a distribution. (For a selected set of possible distributions)
o X is a random variable with normal distribution,
o Y is a random variable with uniform distribution,
o W is a random variable with normal distribution but limited to a number of sigmas on left, and a different number of sigmas on right,
o Z = X + Y (or X / Y or X - Y / W), what is distribution of Z?
I want to build a library that can do arithmetic operations on Random Variables. And I want it to produce the results as new Random Variables. (I probably should call these distributions) Ideally my library should be able to perform at least 4 basic operations on selected distributions: Uniform, Normal, Normal with restrictions (i.e. for example only the positive values or values in a predefined range) and combination of these
Basic addition looks like doable up to a certain point, but when it comes to multiplication and division, I get lost. Every document I read talks about convolutions, PDFs, CDFs, integrals, summations and many things. But I still could not figure out how to formulate this into a program so it can calculate something like this and give me another distribution:
A=((X+Y)*Z)/(W-Q), where all are random variables with different distributions.
and later, I will be able to do another calculation, this time using A, whatever distribution it has.
For simplicity, I do not want to include the indirect-reference cases. (i.e. what will be the distribution for A*X, given A is already calculated using X. In this case, I assume we will take this new X as a new instance of X generated the same distribution function with the original X. So we will not need to store all distributions used to calculate a result for future reference.
So far, I found that, two normal distributed RVs adds up to another normally distributed RV. 2 uniforms adds to a triangle distribution. What happens when I subtract a normal distribution from a triangle distribution? What happens when I divide them? What happens when I multiply the subtraction result with the division result?
This maybe too complicated to implement as a generic library, at least for me, in that case I want to know how much of it is feasible. And if by chance there is a library which does this, it would be awesome!