moments function

Internal: Calculate consistent moments of a nonlinear model