On Mon, 23 Mar 2009, Mathieu Bouchard wrote:
You can send simple repeated sequences to [mapping/variance] to show that not only it can drift in the negative values almost endlessly, but it doesn't even compute the variance of N values.
Here is another patch. I call it [mapping/variance2]. It computes a moving variance using exactly the $1 last values and not any more than that. It has more rounding error, but it doesn't have any unwanted delay between the two moving averages used in computing variance.
#N canvas 744 170 273 272 10; #X obj 39 33 inlet; #X obj 39 184 outlet; #X obj 39 52 t f f; #X obj 39 165 -; #X obj 39 83 t f f; #X obj 39 111 *; #X obj 39 130 mean_n $1; #X obj 114 81 mean_n $1; #X obj 114 101 t f f; #X obj 114 129 *; #X connect 0 0 2 0; #X connect 2 0 4 0; #X connect 2 1 7 0; #X connect 3 0 1 0; #X connect 4 0 5 0; #X connect 4 1 5 1; #X connect 5 0 6 0; #X connect 6 0 3 0; #X connect 7 0 8 0; #X connect 8 0 9 0; #X connect 8 1 9 1; #X connect 9 0 3 1;
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal, Québec