A decision-theory model of danger compensation