View full-text article in PMC Sensors (Basel). 2022 May 8;22(9):3580. doi: 10.3390/s22093580 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 1 Is Intoxicated? 1:Input:Model—Intoxication Detection Model 2:Input:sSober—Gait Measurements while Sober 3:Input:sSuspect—Suspected Gait Measurements 4:Input:Threshold—Confidence threshold 5:Output:Boolean—True/False for intoxication 6:procedure isIntoxicated? 7: fSober[]=features(sSober) 8: fSuspect[]=features(sSuspect) 9: n=length(fSober) 10: difference[]=newarray[n] 11: for (i=0;i<n;i++) do 12: difference[i]=fSuspect[i]−fSober[i] 13: Probability=Model.classify(difference) 14: return(Probability>Threshold)