Presumably it involves quickly calculating the scalar `X_mean[ii] * w[ii]`, then to do the vectorized `+=` converts it to an object, wraps that in an array and broadcasts it to the shape of `R`. In short, this could probably be done quicker in a loop here.