Skip to main content
. Author manuscript; available in PMC: 2024 Aug 14.
Published in final edited form as: J Biomed Inform. 2016 Jul 25;63:54–65. doi: 10.1016/j.jbi.2016.07.020
Algorithm 2. sw-PCAR(Wi, Wj, N)
1:Input:Wi,Wj=two windows of time series data2:Input:N=number of permutaions3:Output:CS=change score4:Output:sig=(Boolean)significance ofCS5:Initialize:k=06:Initialize:Vas a vector of lengthN7:ComputeW^i,W^jaggregate window8:ComputeCS,the KL distance betweenW^iandW^j9:whilek<N:10:Shuffle the time intervals ofW^iandW^j11:Generate new aggregate windowsWiandWj12:Compute the KL distance betweenWiandWj13:Store resulting distance inV14:k=k+1endwhile15:sig=BoxplotOutlierDetection(CS,V)(seeAlgorithm3)16:returnCS,sig