Weighted interval testing for a piecewise-constant mean (source code)

= Weighted interval testing for a piecewise-constant mean

Given valid <p-values> $q_J$ for constancy on intervals of length at least two, reject $I$ when $\max_{J\supseteq I}nq_J/|J|\leq\alpha$. Every rejected true interval forces rejection of its maximal constant block. A <union bound> over the non-singleton maximal blocks gives <familywise error rate> at most $\alpha$, since their lengths sum to at most $n$. Singleton blocks have no tested interval in this formulation.