modeldf function

Compute model degrees of freedom