various embodiments of the present invention utilize entropy and entropy rate for analyzing rhythms , preferably cardiac rhythms . the dynamics of cardiac rhythms can be quantified by entropy and entropy rate under the framework of continuous random variables and stochastic processes . the entropy of a continuous random variable x with density ƒ is h ⁡ ( x ) = e ⁡ [ - log ⁡ ( f ⁡ ( x ) ) ] = ∫ - ∞ ∞ ⁢ - log ⁡ ( f ⁡ ( x ) ) ⁢ f ⁡ ( x ) ⁢ ⁢ ⅆ x if x has variance σ 2 , then y = x / σ has variance 1 and density σƒ ( σy ). so the entropy of y is related to the entropy of x by h ⁡ ( y ) = ∫ - ∞ ∞ ⁢ - log ⁡ ( σ ⁢ ⁢ f ⁡ ( σ ⁢ ⁢ y ) ) ⁢ σ ⁢ ⁢ f ⁡ ( σ ⁢ ⁢ y ) ⁢ ⁢ ⅆ y = h ⁡ ( x ) - log ⁡ ( σ ) which shows that reduced entropy is indicative of reduced variance or increased uncertainty . h ⁡ ( x ) ≤ 1 2 ⁢ ( log ⁡ ( 2 ⁢ ⁢ π ⁢ ⁢ e ) + log ⁡ ( σ 2 ) ) = h ⁡ ( σ ⁢ ⁢ z ) where z is a standard gaussian random variable . this result shows that the gaussian distribution has maximum entropy among all random variables with the same variance . thus , an estimate of entropy that is substantially lower than this upper bound for a random sample ( with sample variance used as an estimate of σ 2 ) provides evidence that the underlying distribution is not gaussian . this type of distribution is a characteristic of some cardiac arrhythmias , such as bigeminy and trigeminy , that are multimodal and is another reason entropy is important for this application . letting x denote the random sequence x 1 , x 2 , x 3 , . . . , the entropy rate of x is defined as h ⁡ ( x ) = lim n → ∞ ⁢ h ⁡ ( x 1 , x 2 , … ⁢ , x n ) n where the joint entropy of m random variables x 1 , x 2 , . . . , x m is defined as h ( x 1 , x 2 , . . . , x m )= e [− log ( ƒ ( x 1 , x 2 , . . . , x m ))] and ƒ is the joint probability density function ƒ . for stationary processes , an equivalent definition is h ⁡ ( x ) = lim m → ∞ ⁢ h m ⁡ ( x ) = lim m → ∞ ⁢ h ⁡ ( x m + 1 ❘ x 1 , x 2 , … ⁢ , x m ) so entropy rate is the entropy of the conditional distribution of the present observation given the past . the entropy rate for i . i . d . sequences reduces to the entropy of the common distribution . estimating the entropy rate for sequences depends on estimates of its densities of order m . let x 1 , x 2 , . . . , x n denote a stationary random sequence and x i ( m ) denote the template consisting of the m × 1 vector ( x i − m + 1 , x i − m , . . . , x i ) t . for notational simplicity , let x n = x n ( n ) denote the whole sequence and x = x ∞ denote the limiting infinite sequence . the sequence x m ( m ), x m + 1 ( m ), . . . , x n ( m ) is not independent , but many methods developed to analyze independent vector data are applicable . in particular , the m th - order probability density function of the sequence , ƒ , and entropy e [− log ( ƒ ( x 1 , x 2 , . . . , x m ))] can still be estimated empirically . these are the fundamental calculations in apen and sampen . the log - likelihood of a random sequence x n can be written as log ⁢ ⁢ l ⁡ ( x n ) = ⁢ log ⁡ ( f ⁡ ( x 1 , x 2 , … ⁢ , x n ) ) = ⁢ ∑ i = 1 n ⁢ ⁢ log ⁡ ( f ⁡ ( x i ❘ x 1 , x 2 , … ⁢ , x i - 1 ) ) and the shannon - mcmillan - breiman theorem [ 13 ] states that for stationary ergodic processes the entropy rate of x is related to the log - likelihood function by h ⁡ ( x ) = lim n → ∞ ⁢ 1 n ⁢ e ⁡ [ - log ⁢ ⁢ l ⁡ ( x n ) ] where the convergence is with probability 1 . as part of our invention , we use the term model - based entropy to indicate the estimate h ^ = h ( x n , θ ^ ) = - 1 n ⁢ log ⁢ ⁢ l ( x n ; θ ^ ) obtained by modeling x by a parameter θ estimated by the mle { circumflex over ( θ )}. in the current application , x represents a sequence from a particular cardiac arrhythmia that follows a particular parametric model . all traditional time - series models , such as autoregressive ( ar ) models , could be applied to cardiac arrhythmias under this approach . in addition to increased flexibility , there is an important connection between this and the current art . in particular , apen corresponds to model - based entropy where the parameters are the transition probabilities of a markov chain of order m and they are estimated empirically . according to preferred embodiments of the present invention , the detection of cardiac rhythms is based on a series of the interbeat or rr intervals , which arise from a complex combination of both deterministic and stochastic physiological processes . a complementary approach included as part of this invention is to consider hr data sufficiently stochastic to model it as a random process . we have developed stochastic renyi entropy rate measures that can be reliably estimated with known statistical properties . embodiments of the present invention involve consideration of the standard error of renyi entropy rate estimates . it is important to know the standard error of entropy rate estimates in order to be able to assess significant differences between cardiac rhythms and conduct meaningful statistical inference . to demonstrate the novel approach of this invention , consider estimating the entropy rate . letting ĥ i =− log ({ circumflex over ( ƒ )} i ), the entropy rate estimate ĥ i , is the mean of the sample ĥ 1 , ĥ 2 , . . . , ĥ n which can be viewed as an observation from a stationary random process . let { circumflex over ( σ )} 2 denote the sample variance and ĉ k denote the sample correlation coefficient at lag k calculated using a divisor of n k = n − k , the number of pairs of observations at lag k . then the variance of the entropy estimate can be estimated by σ h ^ 2 = σ ^ 2 n ⁢ ( 1 + 2 ⁢ ∑ k = 1 k ⁢ ⁢ n k ⁢ c ^ k ) and k is the maximum lag at which the random process has significant correlation . the optimal determination of k is application dependent , but our invention currently uses a conservative approach of selecting the value that results in the largest variance . this same general approach can be used to estimate the standard errors of conditional renyi entropy rates . in this case , the result comes from analyzing the sequence { circumflex over ( ƒ )} 1 q − 1 , { circumflex over ( ƒ )} 2 q − 1 , . . . , { circumflex over ( ƒ )} n q − 1 . an estimate { circumflex over ( σ )} q 2 of the variance can be calculated using the same expression as above with the sample variance and correlation coefficients calculated from this sequence . then , the standard error of the entropy estimated is approximated by σ r ^ q * = σ ^ q  q - 1  ⁢ μ ^ q where { circumflex over ( μ )} q is the sample mean of the sequence . the stochastic renyi entropy rate measures according to the present invention can be interpreted in ways that are analogous to the deterministic concepts of complexity and order , and is not fundamentally different . while developed under a stochastic framework , the algorithms are easily modified to compute deterministic approach measures that include both apen and sampen . there are several basic differences between the stochastic approach and the deterministic approaches , and each has potential application to the detection of cardiac rhythms . first , the deterministic approach involves calculating probabilities while the stochastic approach calculates probability densities . the probabilities involve matches of templates of length m within a tolerance r and converting them to densities by dividing by the volume of the matching region , which is ( 2r ) m . this simply reduces to adding a factor of log ( 2r ) to apen or sampen . the stochastic approach becomes viable when the values converge as r tends to 0 and the deterministic approach is diverging . various embodiments of the present invention use both fixed value of r = 50 msec as well as r = f ( s . d .). with fixed values , there is always the possibility of encountering data that results in highly inaccurate entropy estimates , so included in our invention is the continued development of absolute entropy measures independent of m and r that are statistically reliable and allows for comparison between a wide range of hr data sets . with the stochastic approach , the goal is to estimate the theoretical limiting value as r goes to zero . the value of r for estimation does not need to be fixed and can be optimized for each signal . in addition , for longer records embodiments of the present invention also include in the invention the option of not fixing m and instead estimating the theoretical limiting value as m tends to infinity . one advantage of this general philosophy is that tolerances and template lengths can be selected individually for each signal to ensure accurate estimates . even if it is advantageous or necessary to compare signals at the same value of r , our invention allows the flexibility of using different tolerances for estimation and applying a correction factor . this idea is particularly important in the current setting of estimating entropies of quantized rr intervals obtained from coarsely sampled ekg waveforms . another issue commonly encountered in analyzing rr interval data is that of quantization at the resolution of the sampling rate of the ekg signal . this means that all tolerances r within the resolution will result in the exact same matches and the issue becomes what value r should be used to calculate the entropy rate . the proper choice is to pick the value midway between the quantized values of r . for example , the ekg signal was sampled at 250 hz in the af database and the rr intervals are at a resolution of 4 milliseconds . in this case , all tolerances between , say , 12 and 16 milliseconds would be considered 14 for the log ( 2r ) term . this continuity correction can be nontrivial when tolerances are close to the resolution of the data . this is a novel aspect of our invention that optimizes the accuracy and discriminating capability of the entropy measures . various embodiments of the present invention relate to calculating coefficient of sample entropy ( cosen ), and preferably to af detection using cosen , in short records . for patients with severe heart disease , increased risk of ventricular tachycardia ( vt ), or fibrillation , and especially for patients with implantable cardioverter - defibrillator ( icd ) devices , rapidity of diagnosis is paramount . thus , embodiments of the present invention quantify the diagnostic performance of cosen over short record lengths in comparison to a common variability measure , the coefficient of variation cv . fig5 is a plot of roc area as a function of record length for af detection performance comparing cosen ( q *) to cv on the af and arh databases for all possible overlapping records . in fig5 , the ordinate is receiver - operating characteristic ( roc ) area . in the inset , cv is coefficient of variation and q * is cosen . af is the mit - bih atrial fibrillation database , and arh is the mit - bih arrhythmia database . using cv , the roc areas for detecting af are 0 . 8 to 0 . 9 , and change little for sequences between 4 and 25 beats in length . the roc areas using cosen are higher , especially when 10 or more beats are considered . the improved performance of cosen was evident even for records with fewer than 10 beats , and remained significantly higher than the performance of cv for lengths as short as 5 beats . we define the cosen as the sample entropy of a series after being normalized by the mean . this is equivalent to subtracting the natural logarithm of the mean from the original entropy . to see this , note that if x has mean μ , then y = x / μ has mean 1 and density μƒ ( μy ). so the entropy of y is related to the entropy of x by h ⁡ ( y ) = ∫ - ∞ ∞ ⁢ - log ⁡ ( μ ⁢ ⁢ f ⁡ ( μ ⁢ ⁢ y ) ) ⁢ μ ⁢ ⁢ f ⁡ ( μ ⁢ ⁢ y ) ⁢ ⁢ ⅆ y = h ⁡ ( x ) - log ⁡ ( μ ) as stated . similar results can be shown for all renyi entropy rates and in particular for the differential quadratic entropy rate q calculated using the sampen algorithm . this leads the calculation where q * is the coefficient of sample entropy . as shown below , this modification of entropy rate provides a very powerful univariate statistic for classifying af as part of this invention . in practice , the mean can be estimated with the sample mean or sample median or other robust measures that minimize the effect of noisy , missed , and added beats . to effectively detect cardiac rhythms , there is a need to be able to process short records of rr intervals that possibly includes missed beats due to noise in the ekg or other limitations of the heart monitoring device . an aspect of various embodiments of the present invention includes novel methods to accurately estimate entropy in this setting using the intuitive notion of matches . a match occurs when all the components of between two distinct templates x i ( m ) and x j ( m ) are within a specified tolerance r . the total number of matches for template x i ( m ) is denoted by a i ( m ). for m = 0 , a i ( 0 ) is equal to the maximum number of possible matches which is n if self - matches are included and otherwise n − 1 . an estimate of the conditional probability of x i given x i − 1 ( m ) is p ^ i = p ^ i ⁡ ( m ) = a i ⁡ ( m + 1 ) a i - 1 ⁡ ( m ) h ^ = - 1 n ⁢ ∑ i = 1 n ⁢ ⁢ log ⁡ ( f ^ i ) = - 1 n ⁢ ∑ i = 1 n ⁢ ⁢ log ⁡ ( p ^ i ) + log ⁡ ( 2 ⁢ ⁢ r ) and r ^ q = 1 1 - q ⁢ log ⁡ ( 1 n ⁢ ∑ i = 1 n ⁢ ⁢ p ^ i q - 1 ) + log ⁡ ( 2 ⁢ ⁢ r ) is the estimate of the general conditional renyi entropy rate . in the sums above , all observations are shown while the conditional probability estimates are not always defined . in this case , they can be defined by some convention or left out of the sum with the option of adjusting the divisor n to reflect these omissions . the analog of sample entropy , i . e . the quadratic differential entropy rate , is estimated by q ^ = - log ⁡ ( a ⁡ ( m ) b ⁡ ( m ) ) + log ⁡ ( 2 ⁢ ⁢ r ) where a ⁡ ( m ) = ∑ i = 1 n ⁢ ⁢ a i ⁡ ( m + 1 ) and b ⁡ ( m ) = ∑ i = 1 n - 1 ⁢ ⁢ a i ⁡ ( m ) are the total number of matches of length m + 1 and m . note that most all of the above expressions involve slightly modified manipulation of the fundamental summary statistics a i ( m ). these estimates involve taking logarithms of ratios that become inaccurate or undefined when the numerator and or the denominator are not sufficiently large . this becomes less likely an issue using the total number of matches , and this is a main reason that sampen has proven to be a more reliable and robust statistic for analyzing heart rate variability . self - matches are included in the definition of apen to overcome problems of infinite or indeterminate ratios , but it still can suffer from significant loss of accuracy when the number of matches is small . in order to improve the accuracy of apen and other conditional entropy rates , we introduce an algorithm that only calculates ratios with specified minimum values of the numerator and denominator , denoted respectively by n 0 and d 0 . the conditional distribution of each observation can be calculated using increasing number of previous observations , but at some template length the number of matches fall below the prescribed minimum . to avoid this possibility , we define a new conditional density estimate f ^ i * ⁡ ( m ) = f i ⁡ ( m * ) where m * = m * ⁡ ( i ) = max 0 ≤ k ≤ m ⁢ { a i ⁡ ( k + 1 ) ≥ n 0 , a i - 1 ⁡ ( k ) ≥ d 0 } for each m and observation i . this algorithm ensures that each individual contribution to the sums in ( 30 ) or ( 32 ) has some minimum degree of statistical reliability . this also enables the inclusion of long template matches when they are present and facilitates the goal of not fixing m and estimating the limiting parameters . embodiments of the present invention involve estimating the standard error of sample entropy and cosen . the above methods , which apply to calculations of conditional entropy rates , need to be expanded slightly to allow for application to methods using the sample entropy . recall that for a sequence of data , a set of m consecutive points is called a template and can be considered a vector . an instance where all the corresponding components of two such vectors are within a distance r of each other is called a match . let b i and a i denote the number of matches with templates starting with the i th point of the sequence of lengths m and m + 1 . respectively . then the total number of matches of length m and m + 1 are b = ∑ i = 1 n - m ⁢ ⁢ b i . the conditional probability p of a match of length m + 1 . given a match of length m can then be estimated by p = a / b . as presented in [ 16 ], the standard error of p can be estimated by σ p 2 = σ a 2 b 2 - 2 ⁢ ⁢ a ⁢ σ ab 2 b 3 + a 2 ⁢ σ b 2 b 4 where σ a 2 is the variance of a , σ b 2 is the variance of b , and σ ab 2 is the covariance between a and b . the sample entropy is equal to − log ( p ) and the corresponding estimate of the standard error is σ p / p . using a methodology similar to that introduced in lake d e , renyi entropy measures of heart rate gaussianity . ieee transactions on biomedical engineering , volume 53 ( 1 ): 21 - 27 , 2006 , results in the following estimates σ a 2 = n - m 4 ⁢ ∑ k = - k k ⁢ ⁢ ∑ i = 1 n - k ⁢ ⁢ ( a i - a _ ) ⁢ ( a i + k - a _ ) σ ab 2 = n - m 4 ⁢ ∑ k = - k k ⁢ ⁢ ∑ i = 1 n - k ⁢ ⁢ ( a i - a _ ) ⁢ ( b i + k - b _ ) σ b 2 = n - m 4 ⁢ ∑ k = - k k ⁢ ⁢ ∑ i = 1 n - k ⁢ ⁢ ( b i - b _ ) ⁢ ( b i + k - b _ ) where ā = a /( n − m ), b = b /( n − m ), and k is the maximum lag at which the sequences { a i } and { b i } have significant correlation . these estimates differ from those provided in [ 16 ] in that they do not fully account for all the dependencies present in the calculations . the advantage of these expressions , especially for processing large amounts of data as is done in this paper , is that they require less computation and preliminary comparison of the methods suggest that they agree favorably with the more accurate method . the optimal determination of k is application dependent , but the nature of the calculations suggests that a minimum value of m is required . a conservative approach used in this work selects the value that results in the largest variance . the factor of 4 in the above expressions comes from the fact that the expressions for a and b count each match twice . the coefficient of sample entropy involves a first term with the sample entropy and second term involving the natural logarithm of the sample mean . the standard deviation of cosen to take into account the additional variation of this second term which can be reasonably assumed to be uncorrelated with the sample entropy term . the standard deviation of the sample mean x can be estimated by s /√{ square root over ( n )} where s is the sample standard deviation and n is the length of the segment of rr intervals being analyzed . then the standard deviation of q *, denoted by σ *, can be estimated by : σ * = σ p 2 p + s 2 n ⁢ x _ 2 = σ p 2 p + c ⁢ ⁢ v 2 n to demonstrate the robustness of the new algorithm , fig7 shows the mean results of estimating the entropy rate for 100 simulations of gaussian white noise ( n = 4096 ). the tolerance r was set to 0 . 2 times the sample standard deviation for these and other entropy estimates shown below . the variants of the algorithms shown are no restrictions on the denominator ( d 0 = 1 ) with self - matches , d 0 = 10 with self - matches , and d 0 = 10 without self - matches . in all cases , n 0 = 1 to avoid taking the logarithm of 0 . the standard error for all these estimates is less than 0 . 002 . the unrestricted estimate is analogous to the traditional apen algorithm which clearly starts to rapidly degenerate after m = 2 . with d 0 = 10 and the new algorithm , the estimates converge to stable values of on average 1 . 143 with self - matches and 1 . 433 without . this latter result agrees favorably with the theoretical value of ( log ( 2π )+ 1 )/ 2 = 1 . 419 and is an indication of the improved accuracy of the new invention . the present invention involves segmentation of heart rate data into homogeneous cardiac rhythms . characterizing heart rate data containing 2 or more different rhythms presents a significant challenge . while analyzing short records helps to mitigate this problem , a better solution is to restrict analysis to segments that have been identified as likely containing a homogeneous cardiac rhythm . homogeneity can be defined , for example , in terms of the mean , standard deviation , or other parameters of the rr interval distribution . additionally , characteristics of the dynamics of a segment , such as the entropy or correlation function , can be parameters to consider . for a set of parameters , the homogeneity of a segment can be measured based on the “ goodness of fit ” with some objective function which increases as a segment becomes more nonhomogeneous . a simple example would be the sum of squared deviations of the rr intervals from the mean of a segment . note that the self - matches , d 0 = 1 curve , corresponding to the traditional approximate entropy algorithm , quickly degenerates after m = 2 . in the same spirit as impurity measures for classification and regression trees ( cart ) and wavelet packets , this objective function can be termed “ entropy .” to accomplish this goal , we employ a novel method that automatically optimally divides heart rate data into homogeneous segments . the methodology will be based on an algorithm we call minimum piecewise entropy . minimum piecewise entropy was originally developed to detect transient sonar signals and is described below . the approach is to hypothesize that the data is made up of some number of homogeneous segments and to optimally estimate the number k and location of change points where the process is altered in some manner such as a shift in the mean . if the data is already homogeneous , the algorithm should ideally estimate k to be 0 and no segmentation would occur . the entropy of each stationary segment of data is calculated and the criteria for optimality will be the piecewise entropy of the data which is calculated as the sum of the individual components . as mentioned above , entropy could be any of a variety of measures including the sum of the squares of the residuals or the log - likelihood function after a particular model has been fit to the data . once a criterion has been determined , the problem becomes how to select among the all the possible ways a set of n points could be partitioned into k segments . fortunately , there exists an efficient dynamic programming algorithm to do this optimization . to see this let e ( i , j ) denote the minimum entropy for x ( i ), x ( i + 1 ), . . . , x ( j ). also define e ( j )= e ( 1 , j )= minimum piecewise entropy for x ( 1 ), x ( 2 ), . . . , x ( j ). the minimum piecewise entropy can be found efficiently using dynamic programming because the entropy is assumed additive , that is , e ( i , j )= e ( i , k )+ e ( k + 1 , j ). the recursive algorithm to find the minimum piecewise entropy e is e ( 0 )= 0 and e ( j )= min 1 ≦ i ≦ k { e ( i − 1 )+ e ( i , j )} all else being equal , fewer change points are preferable in estimating the piecewise entropy . the algorithm for minimum piecewise entropy can be modified slightly to estimate the entropy using a certain number of change points . define e ( j , k )= minimum piecewise entropy for x ( 1 ), x ( 2 ), . . . , x ( j ) using k change points and the recursive algorithm generalizes to e ( 0 , k )= 0 and e ( j , k )= min 1 ≦ i ≦ k { e ( i − 1 , k − 1 )+ e ( i , j )} for k = 0 , 1 , . . . , k and j = 1 , 2 , . . . , n where k is some specified upper bound . various embodiments of the present invention , and the improved results obtained therefrom , are illustrated by way of the following , non - limiting examples . results from the method of the present invention method have been compared to the ks distance method of tateno and glass in the canonical and publicly available mit - bih af database . representative predictive models perform well in detecting af , as assayed by receiver - operating characteristics ( roc ) areas as shown later . note that the method of various embodiments of the present invention only requires a few coefficients for implementation regardless of number of af patients used to train model . this is more efficient than repeated comparisons to multiple histograms , as is called for in the ks distance method of tateno and glass . in these examples univariable and multivariable methods were used to classify cardiac rhythms , employing logistic regression and its variations . segments of 50 - point non - overlapping records are separated into binary outcomes with 1 denoting normal sinus rhythm or 0 denoting a cardiac arrhythmia such as atrial fibrillation . a variety of the moment and entropy rate parameters described above are estimated for each record and cardiac rhythm classifiers are developed using an optimal parsimonious subset of variables . for purposes of this example , an optimal subset of variables for the mit - bih atrial fibrillation database is the quadratic differential entropy rate ( q ), the mean ( μ ), and the standard deviation ( σ ) of the rr intervals . the entropy rate is calculated using the sampen algorithm with parameters m = 1 and r = 50 milliseconds . this result aided in the development of the coefficient of sample entropy ( q *) which is described in more detail below . we also compare these results with the coefficient of variation cv = σ / μ subsets of parameters are evaluated using the significances of individual coefficients and of the overall model using the wald statistic adjusted for repeated measures . the overall significance of the model can be converted to a wald z - statistic which can be used to make a fair comparison among models with varying number of parameters . the models are also verified on the independent mit - bih arrhythmia database . the database is divided into 2075 non - overlapping 50 point records with 184 ( 8 . 9 %) af records . the results of this analysis are summarized below in table 2 . the parameter tg represents results using the ks distance method of tateno and glass . in 920 , 242 50 - beat records we calculated cv , ks distance ( that is , we implemented the method of tateno and glass ), and cosen . fig2 shows frequency histograms of the results , i . e ., of time series measures in 422 24 - hour holter monitor records from the university of virginia heart station . the multimodal nature suggests that different components contribute to the overall distribution . we dissected the components using sums of 3 gaussians functions , shown as smooth lines representing an expression of the form : f ⁡ ( x ) = a 1 σ 1 ⁢ 2 ⁢ ⁢ π ⁢ ⅇ - ( x - μ 1 ) 2 / 2 ⁢ ⁢ σ 1 2 + a 2 σ 2 ⁢ 2 ⁢ ⁢ π ⁢ ⅇ - ( x - μ 2 ) 2 / 2 ⁢ ⁢ σ 2 2 + a 2 σ 2 ⁢ 2 ⁢ ⁢ π ⁢ ⅇ - ( x - μ 2 ) 2 / 2 ⁢ ⁢ σ 2 2 , where a is the proportion of the total area attributed to each component , and μ and σ are the mean and standard deviation of each component . the largest component is attributed to normal sinus rhythm ( nsr ), and the next largest is attributed to atrial fibrillation ( af ). the smallest , which always is intermediate in location , is attributed to premature ventricular contractions ( pvcs ) and premature atrial contractions ( pacs ). these assignments are borne out qualitatively by inspection of individual records . a limitation , though , to this analysis is that we have not verified the rhythm labels of every beat . we know from inspection of some of the records , that the labeling is not altogether accurate . in each case , the numerical analyses were correct in classifying the rhythm label . there was reasonable agreement about the relative proportions of rhythm labels using the cv , ks distances , and cosen . the proportions of nsr were 0 . 87 , 0 . 81 and 0 . 85 , respectively , and the proportions of af were 0 . 12 , 0 . 06 and 0 . 11 , respectively . the most important differences lie in the detected af burdens — 6 % in the tateno - glass ks distance method and 11 % using the new cosen measure . the burden of other rhythms is even more different — 13 % compared with 4 %, respectively . another important finding is a sensible cut - off for detecting af using cosen . both by visual inspection of the histogram and by analysis of the gaussian fit , we select cosen =− 1 as a threshold value , and we classify records with lower values as nsr and higher values as af . analysis of the areas of the components of the sum of 3 gaussians fit suggest that 11 % of data are misclassified using cosen compared with 28 % using cv and 8 % using ks distances . fig1 , 3 , and 4 show three of the 24 - hour holter monitor recordings , and rr intervals are classified as nsr ( blue ) or af ( green ) using only cosen , which is shown as a purple line at the bottom . the cut - off of cosen =− 1 was chosen by eye from inspection of the frequency histogram of cosen values in 420 consecutive holter recordings . fig3 and 4 show uninterrupted nsr and af , respectively . fig1 shows a record with paroxysms of af . there is good agreement between the cosen value and the appearance of the time series . note that the y - axis is rr interval , and af is characterized by faster rates ( shorter intervals ) as well as increased variability . the minimum piecewise entropy algorithm was applied to the mit - bih arrhythmia database prior to applying our logistic regression model to predict the presence of atrial fibrillation train on the mit - bih atrial fibrillation database . the algorithm was applied to pick the optimal change points for segments with homogeneous mean and variance . the optimal number of change points was selected using a penalty based on the number of segments and the length of the data record as previously described ( see lake d e . efficient adaptive signal and signal dimension estimation using piecewise projection libraries wavelet applications v , h . h . szu , editor , proc . spie vol . 3391 , p . 388 - 395 , 1998 , and lake d e . adaptive signal estimation using projection libraries ( invited paper ) wavelet applications iv , h . h . szu , editor , proc . spie - 3078 , p . p . 602 - 609 , 1997 ). an example is shown in fig6 . the optimal number of segments was found to be 18 with lengths ranging from 22 to 341 beats . this procedure was repeated for all 48 subjects in the database resulting in 525 homogeneous segments . the moments and entropy for each segment were calculated and evaluated for the presence of af . table 3 , summarizes the results with a threshold of 0 . 8 and compares the results to the method of tateno and glass ( as summarized in table 3 of k . tateno and l . glass , “ automatic detection of atrial fibrillation using the coefficient of variation and density histograms of rr and δrr intervals ,” med biol eng comput vol . 39 , 664 - 671 , 2001 .) this example demonstrates an alternative embodiment of the optimal segmentation process according to the present invention . an advantage of this embodiment is exact identification of start and stop times of af . to preserve near - real time performance , it is implemented only when the rhythm is perceived to change into or out of af . an evaluation of the mit arh and af databases using american national standards ansi / aami ec38 : 1998 was conducted to evaluate cosen performance on af detection in the mit arh and af databases . the 50 previous and the 50 subsequent beats were used to identify homogenous segments for classification using cosen . this requires a delay of 50 beats , and the algorithm is considered near - real time . the following order of operations was employed : ( 1 ) cosen was calculated on non - overlapping 16 beat segments ; ( 2 ) beats were labeled in each segment as af or non - af based on a threshold value determined from the uva holter database ; ( 3 ) when the label changed , the near - real time segmentation analysis was implemented to determine whether there was a statistically significant change in the rhythm and , if so , the exact beat at which the label should change ; ( 4 ) in the arh database , any segments with more than 25 % of beats labeled as ectopic were classified and labeled as non - af . results are displayed in tables 4 and 5 . note that the output is in standard sumstats format . excellent performance in the mit arh and af databases does not necessarily translate into robust real - world results , because of various problems with the mit databases . the rr interval time series in the arh database of the 2 patients with af with the results of our analysis compared with the ekg interpretation . ekg waveforms from some of the disputed areas are shown in figs . fig8 shows the complete 30 minute rr interval time series from record 202 , a complex record with obvious rhythm changes . fig9 shows our labeling strategy — blue dots are rr intervals in which we agree with the electrocardiographer who labeled the database , red dots are intervals we labeled as af but s / he did not , and green dots we did not label as af but s / he did . the open bars below show duration of af episodes as labeled by the electrocardiographer ( in green ), and as detected by our numerical algorithm ( in purple ). several areas are identified by circled numbers , and the corresponding ekg strips are shown . strip 1 , in fig1 , shows sinus rhythm that we agree on . strip 2 , in fig1 , was detected by us as af but is obviously not af — it is sinus rhythm with very , very frequent atrial ectopy . this rhythm is sometimes a harbinger of af , but is not af . it is not surprising that we detect it as af because of its irregularity . strip 3 , in fig1 , was not detected by us as af but was labeled as af by the electrocardiographer . inspection of the entire record shows that the rhythm is af with varying degrees of organization , or atrial flutter - like qualities . for this epoch , the atrial activity was rather organized resulting in a more regular ventricular rhythm , hence our misdiagnosis . clinically , the patient would be treated for af . strip 4 , in fig1 , is clearly af , and we agree . strip 5 , in fig1 , is essentially identical to strip 3 . we called neither af . the electrocardiographer called the first one af and the second one atrial flutter . this is inconsistent , and emphasizes the problem with using these databases as the gold standard for arrhythmia diagnostics . fig1 shows the entire 30 minute rr interval time series for record 203 . there is no obvious change in rhythm , and we detect af throughout . the electrocardiographer found the section in the middle to be atrial flutter and the rest to be af . in fig1 , strips 6 and 7 show , to our eye , identical rhythm that we would characterize as somewhat organized af with either pvcs or aberrantly conducted impulses . we see no reason to call them different rhythms . the conclusion is that the labeling of rhythm in the arh database is open , in some places , for discussion . a detection algorithm that correctly follows all of the arh labeling is , in our opinion , overfit . a first limitation for arrhythmias other than af is recognized . false negatives are expected in atrial flutter and af with a more organized atrial activation — these are more regular rhythms and resistant to diagnosis by changes in entropy . this problem is recognized in the epicmp analysis , which excludes atrial flutter episodes from evaluation of af detection . false positives are expected in frequent ectopy , atrial or ventricular — these are irregular rhythms for the most part , and will have higher entropy . a second limitation is recognized with regard to arbitrary use of 30 seconds as a minimum length of af . this is untested from a clinical point of view , and it is possible that even these short episodes increase stroke risk . this problem is shared by all af detection strategies . this example focuses on the uva holter database . more specifically , this example examines cosen distributions in consecutive patients . more than 600 consecutive 24 - hour holter recordings , including digitized waveforms , rr intervals and rhythm labels from the philips system are available . furthermore , this example inspects of the ekg waveforms to verify the rhythm labeling in records of patients over 45 years of age in whom atrial fibrillation ( af ) was detected . in addition , this example involves inspection of the first 100 consecutive records . first , regarding af detection using cosen in the uva holter database , fig1 shows histograms of cosen of more than 700 , 000 16 - beat segments from 114 24 - hour records for which the rhythm labels of normal sinus rhythm ( nsr ) or af have been corrected . there is reasonable separation , and a cut - off value of − 1 is suggested from inspection . note that there is a little hump in the tail to the left in the histogram of cosen in af , centered on cosen values around − 2 , indicating a more regular set of rr intervals than the rest of the group . these data have been identified and the corresponding ekg will be inspected more closely . because of record selection , af is over - represented in these histograms . overall , about 10 % of the data set seems to be af . we have characterized the rhythms as af or not , based on ( 1 ) cosen calculation of 16 - beat segments and ( 2 ) near - real time segmentation , and compared the results to our labeling from ekg inspection . the results in epicmp and sumstats format for the 22 patients over age 45 ( of more than 70 total ) that have been inspected with at least some detected af are presented in table 6 . by inspection of consecutive records , circumstances can be identified in which false positive and negative findings of af occur . false positives ( high entropy not due to af ) occur in circumstances of very frequent pvcs or pacs ; very high heart rate variability in the young ; sa wenckebach ; and / or multifocal atrial tachycardia . false negative readings of af ( low entropy despite af ) occur in circumstances of atrial flutter or organized af with regular ventricular response ( recall that epicmp excludes atrial flutter from its analysis ); and / or very slow heart rates . as an example of the potential capability of the algorithm , results for a holter showing paroxysmal af are presented . in this small data set , this was the only record with false negative findings using cosen . fig1 and fig1 show the rr interval time series as points , and the af episode durations as open bars below . fig1 is the entire 24 hours , and fig1 is the second hour of the recording . in these figures , blue points are rr intervals for which cosen agrees with our own interpretation of the ekg , whether nsr or af ; red points are intervals that cosen labeled as af but were not af by ekg inspection ; green points are af intervals by ekg inspection that cosen did not label as af ; and open bars show duration of af episodes by ekg inspection in green , and as detected by cosen in purple . examination of fig1 , by eye , demonstrates that the agreement is good . thus the major findings are that cosen detects af , and the segmentation assigns onsets and offsets accurately . fig1 shows histograms of cosen calculated in 16 - beat segments from the entire mit af ( top panels ) and arh ( middle panels ) databases and from the more than 100 uva holter recordings that we have overread ( bottom panels ). the left - hand panels are all rhythms other than af , and the right - hand panels are af alone . the findings are of higher cosen in af , with similar properties in the mit and uva databases . note the labeling of the y - axes — the uva database has more than 100 times as much af as the mit arh database , and is growing . the histogram of cosen in af at uva , presented in fig1 , differs from the one showed in example 6 . the “ small tail ” to which attention was drawn in example 6 , arose from a single patient . the rr interval time series of that record showed long segments of very regular rhythm , but no atrial activity was seen in the 3 ekg leads from the holter recording . a 12 - lead ekg from that day , though , showed unmistakable atrial activity that was either atrial flutter or atrial tachycardia but was not af . this record ( like all the records with atrial flutter ) was removed from the af set , which now numbers 29 . these findings suggest that the uva database should be an acceptable test bed for arrhythmia detection algorithms , and a candidate as a surrogate for the mit databases for fda approval . table 7 presents epicmp and sumstats for 29 uva holter recordings . note that in table 7 , about 95 % of the data is af . note also that record 384 has a large number of false positives . the ekg shows very frequent atrial ectopy and a very variable rhythm , but nonetheless is not af . the finding is that cosen measurements of 16 - beat segments and implementing a near - real time segmentation algorithm has excellent performance in detecting af in patients who are evaluated for that diagnosis . the following references are hereby incorporated by reference herein in their entirety : k . tateno and l . glass , “ automatic detection of atrial fibrillation using the coefficient of variation and density histograms of rr and δrr intervals ,” med biol eng comput vol . 39 , 664 - 671 , 2001 . [ 2 ] s . pincus , “ approximate entropy as a measure of system complexity ,” proc . natl . acad . sci ., vol . 88 , pp . 2297 - 2301 , 1991 . [ 3 ] j . richman and j . moorman , “ physiological time series analysis using approximate entropy and sample entropy ,” amer j physiol , vol . 278 , pp . h2039 - h2049 , 2000 . [ 4 ] d . lake , j . richman , m . griffin , and j . moorman , “ sample entropy analysis of neonatal heart rate variability ,” amer j physiol , vol . 283 , pp . r789 - r797 , 2002 . [ 5 ] m . costa , a . goldberger , and c . peng , “ multiscale entropy analysis of complex physiologic time series ,” phys . rev . lett ., vol . 89 , no . 6 , p . 068102 , 2002 . [ 6 ] j . beirlant , e . j . dudewicz , l . gyorfi , and e . c . van der meulen , “ nonparametric entropy estimation : an overview ,” international journal of math . stat . sci ., vol . 6 , no . 1 , pp . 17 - 39 , 1997 . [ 7 ] o . vasicek , “ a test for normality based on sample entropy ,” journal of the royal statistical society , series b , vol . 38 , no . 1 , pp . 54 - 59 , 1976 . [ 8 ] a . hyvarinen , j . karhunen , and e . oja , independent component analysis . john wiley and sons , 2001 . [ 9 ] m . jones and r . sibson , “ what is projection pursuit ?” journal of the royal statistical society , series a , vol . 150 , pp . 1 - 36 , 1987 . [ 10 ] b . ripley , pattern recognition and neural networks . cambridge university press , 1996 . [ 11 ] l . breiman , j . friedman , r . olshen , and c . stone , classification and regression trees . monterey , calif . : wandswork and brooks - cole , 1984 . [ 12 ] r . t . and c . n ., goodness - of - fit statistics for discrete multivariate data . new york : springer - verlag , 1988 . [ 13 ] c . e . shannon , “ a mathematical theory of communication ”, bell system technical journal , vol . 27 , pp . 379 - 423 & amp ; 623 - 656 , july & amp ; october , 1948 [ 14 ] h . kantz and t . schreiber , nonlinear time series analysis . cambridge : cambridge university press , 1997 . [ 15 ] p . brockwell and a . davis , time series : theory and methods . springer , 1991 . [ 16 ] j . richman , “ sample entropy statistics ,” ph . d . dissertation , university of alabama birmingham , 2004 . [ 17 ] b . l . s . p . rao , nonparametric functional estimation . london : academic press , inc ., 1983 . [ 18 ] d . erdogmus , k . hild , j . principe , m . lazaro , and i . santamaria , “ adaptive blind deconvolution of linear channels using renyi &# 39 ; s entropy with parzen window estimation ,” ieee transactions on signal processing , vol . 52 , no . 6 , pp . 1489 - 1498 , 2004 . [ 19 ] lake d e , renyi entropy measures of heart rate gaussianity . ieee transactions on biomedical engineering , volume 53 ( 1 ): 21 - 27 , 2006 . [ 20 ] lake d e . efficient adaptive signal and signal dimension estimation using piecewise projection libraries wavelet applications v , h . h . szu , editor , proc . spie vol . 3391 , p . 388 - 395 , 1998 . [ 21 ] lake d e . adaptive signal estimation using projection libraries ( invited paper ) wavelet applications iv , h . h . szu , editor , proc . spie - 3078 , p . p . 602 - 609 , 1997 . the following patents , applications and publications are hereby incorporated by reference herein in their entirety : u . s . patent publication no . 2005 / 0004486a1 to glass et al ., entitled “ detection of cardiac arrhythmia using mathematical representation of standard deltarr probability density histograms ;” u . s . patent publication no . 2005 / 0165320a1 to glass et al ., entitled “ method and system for detection of cardiac arrhythmia ;” international patent publication no . wo 03 / 077755a1 to tateno et al ., entitled “ detection of cardiac arrhythmia using mathematical representation of standard δrr probability density histograms ;” international patent publication no . wo 02 / 24068a1 to glass et al ., entitled “ method and system for detection of cardiac arrhythmia ;” european patent no . ep1485018 to tateno et al ., entitled “ detection of cardiac arrhythmia using mathematical representation of standard drr probability density histograms ;” and european patent publication no . ep1322223a1 to glass et al ., entitle “( eng ) method and system for detection of cardiac arrhythmia .”