The variable diffs get set to a list of the three estimates. Adding them up we get −0.424. What has gone wrong?
X, Y, and Z are all 1⁄2. But they are tricky to measure. (defun x () (random 1.0)) is modelling the idea that when we estimate X we get a random variable uniform from 0.0 to 1.0.
(defun x-y () (- (x) (y)))
is modelling the idea that we estimate X and estimate Y and subtract. (And don’t remember our estimate)
(defun y-z () (- (y) (z)))
is modelling the idea that we start from scratch, estimating Y (again) and then Z before finally subtracting.
Since the Y in X-Y is our first go at estimating Y and the Y in Y-Z is our second go at estimating Y, they have different random errors and don’t cancel like they should.
I fear that I’ve missed your point, but here is my runnable toy model written in Common Lisp
The variable diffs get set to a list of the three estimates. Adding them up we get −0.424. What has gone wrong?
X, Y, and Z are all 1⁄2. But they are tricky to measure. (defun x () (random 1.0)) is modelling the idea that when we estimate X we get a random variable uniform from 0.0 to 1.0.
is modelling the idea that we estimate X and estimate Y and subtract. (And don’t remember our estimate)
is modelling the idea that we start from scratch, estimating Y (again) and then Z before finally subtracting.
Since the Y in X-Y is our first go at estimating Y and the Y in Y-Z is our second go at estimating Y, they have different random errors and don’t cancel like they should.