Skip to main content
. 2022 Dec 8;22(24):9636. doi: 10.3390/s22249636
Algorithm 1changepost

Require:ψ^∗={ψ^1∗,⋯,ψ^K∗∗}; si=(Yi−Y^i)2/wi; S={s1,⋯,sn}; start=1; end=n

Ensure:ψ^

    

  • 1:

    for(iin1:K∗)do

  • 2:

        if (i==1) then

  • 3:

            ratio[i]←var(S[start:ψ^i∗])var(S[start:ψ^i+1∗])

  • 4:

        end if

  • 5:

        if (1<i<K∗) then

  • 6:

            ratio[i]←var(S[ψ^i−1∗:ψ^i∗])var(S[ψ^i−1∗:ψ^i+1∗])

  • 7:

        end if

  • 8:

        if (i==K∗) then

  • 9:

            ratio[i]←var(S[ψ^i−1∗:ψ^i∗])var(S[ψ^i−1∗:end])

  • 10:

        end if

  • 11:

    end for

  • 12:

    ratio[ratio<1]←(ratio[ratio<1])−1

  • 13:

    ψ^←ψ^∗[which(rank(ratio)>K∗−2)]