The calculus of loss