Cookbook: statistics. Closes #82.