runlength function

Determine run length of a CUSUM chart