Anger and the like are attributed to God on account of a similitude of effect. Thus, because to punish is properly the act of an angry man, God’s punishment is metaphorically spoken of as His anger.