Skip to main content
. 2018 Sep 14;20(9):709. doi: 10.3390/e20090709
Algorithm 1 Detecting at most one change-point
Input: sequence π=π(k)k=tstarttend of ordinal patterns of order d, nominal probability α of false alarm
Output: estimate of a change-point t^* if change-point is detected, otherwise return 0.
  • 1:

    functionDetectSingleCP(π, α)

  • 2:

        Tmin(d+1)!(d+1);

  • 3:

        if tendtstart<2Tmin then

  • 4:

            return 0;           ▷ sequence is too short, no change-point can be detected

  • 5:

        end if

  • 6:

        t^*arg maxt=tstart+Tmin,,tendTminCEofOP(t;π);

  • 7:

        Nboot5α;         ▷ number of bootstrap samples for computing threshold

  • 8:

        for l=1,2,,Nboot do           ▷ computing threshold by reshuffling

  • 9:

            ξ ← randomly shuffled blocks of length (d+1) from π;

  • 10:

            cjarg maxt=tstart+Tmin,,tendTminCEofOP(t;ξ);

  • 11:

        end for

  • 12:

        cj ← Sort(cj); ▷ sort the maximal values of CEofOP for bootstrap samples in decreasing order

  • 13:

        hcαNboot

  • 14:

        if S(t^*;π)<h then

  • 15:

            return 0;

  • 16:

        else

  • 17:

            return t^*;

  • 18:

        end if

  • 19:

    end function