Skip to main content
. 2025 Sep 2;25(17):5413. doi: 10.3390/s25175413
Algorithm 2 Detection of regimes in round-trip time sequences
function DetectRegimes(X,δ,s)
    X=x1,x2,,xn is the scenario, δ the distribution, s>0 the min. regime length
    R ▹ list of regimes detected
    l ▹ last model (regime) found
    f01 ▹ start index of the last model within X
    for f1,n do
        if ff0+1s then
           mAssessModel(xf0,xf,δ) ▹ MLE + GoF of segment [f0,f] with distrib. δ
           if m= then ▹ failed model with the new RTT xf
               if l then ▹ last model ended here
                   RR(f0,f,l) ▹ new regime is built with last valid model
                   l ▹ no last model
                   f0f xf has not been used for building last regime
               else ▹ no previous model; slide the window forward
                   f0f0+1
               end if
           else ▹ model assessed ok; go on extending it
               lm
           end if
        end if
    end for
    if l then ▹ trailing model
        RR(f0,n,l)
    end if
    return R
end function