RF: set computed means and variances as attributes instead of local variables (this way they can be accessed from outside the object, e.g. from the callback function).