Calculate theta regularization term.