Re:Glucosamine Supplementation Reduces All-Cause Mortality: ...
by crdrost on Sunday August 02, 2020 @01:27AM
(#24026575)
I do not know why you are simulating this system.
Given random x, y, controlling for z = x + y trivially generates a perfect anticorrelation as x = z – y.
Like, I get that you want to make a point, just seems weird to have a numerical solution in 5 lines of code to a problem that was already theoretically solved when you wrote down the problem statement and therefore required exactly 0 equations...?
Also like the theoretical solution clarifies that this happens for arbitrary probability distributions equally, it is not specific to Bernoulli random variables.
If you want to see it yourself, let's simulate this system in R: