I'm having trouble with the following.
I have the test statistic $S_n(x)$:
$S_n(x)=\sup_{x\in R}|Q_n(x)|$,
where
$Q_n(x)=1/\sqrt{n}\sum_{t=1}^n\triangle y_t 1\{y_{t-1}\leq x\}$,
where $1\{\}$ is an indicator function and $\triangle y_t=y_t-y_{t-1}$. I'm trying to implement this in R to be able to calculate the test statistic $S_n(x)$ for different $y_t$, but Im not sure how one would find supremum of an indicator function. I have done it numerically but would really love to find a better way to do it. Any help is very appreciated!