Online and Statistical Learning in Networks