Modeling the Deterrent Effects of Punishment