[...] demonstrates the relative timing of loops versus vectorized computation, see my previous article on timing performance: looping versus using the LOC function. For some statistical tasks, it is not obvious how to vectorize the operations. For example, if …