Determines the runs (segments) in z over which the value does not
change, ignoring missing values. Used by
interpolate_trajectory to split a patient's stage
trajectory into per-stage segments.
Determines the runs (segments) in z over which the value does not
change, ignoring missing values. Used by
interpolate_trajectory to split a patient's stage
trajectory into per-stage segments.