0

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!

Mostafa Ayaz
  • 31,924
  • 2
    The supremum of an indicator function is its maximum: $1$ if the set is not empty, or $0$ for the empty set. – aschepler Sep 11 '23 at 15:37
  • Thank you for the reply. I am a bit confused about your answer. How would one effectively find the the supremum with the method you are describing? – Søren Thode Sep 12 '23 at 13:52
  • I assume $y_t$ will depend on $x$. So knowing that the indicator is always zero or one isn't the hard part of finding $\sup |Q_n|$. I don't know enough about your problem to say much more. – aschepler Sep 12 '23 at 19:58

0 Answers0