function to calculate sequence of cusum test statistics by Leybourne, Taylor, and Kim (2006). For internal use only
cusum(x, trend, m = 0, tau)