View full-text article in PMC Sensors (Basel). 2022 Dec 8;22(24):9636. doi: 10.3390/s22249636 Search in PMC Search in PubMed View in NLM Catalog Add to search Copyright and License information © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/). PMC Copyright notice 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)]