ndiffs function

Number of differences required for a stationary series