Skip to contents

Sample entropy (SampEn) of a 1-D signal: \(-\log(A / B)\), where \(A\) counts template-vector matches at embedding dimension \(m + 1\) and \(B\) at dimension \(m\), with Chebyshev distance tolerance \(r \cdot \mathrm{sd}(x)\).

Usage

sampen(x, m = 2L, r = 0.2)

Arguments

x

Numeric vector.

m

Embedding dimension (default 2).

r

Tolerance as fraction of sd (default 0.2).

Value

List with value (SampEn), name, and extra (m, r, tolerance, A, B).

Details

Reference: Richman, J.S. & Moorman, J.R. (2000) "Physiological time- series analysis using approximate entropy and sample entropy", Am. J. Physiol. Heart Circ. Physiol. 278(6):H2039–H2049 (refines Pincus, S.M. (1991), Proc. Natl. Acad. Sci. USA 88:2297).

Examples

# \donttest{
set.seed(1)
x <- sin(seq(0, 10 * pi, length.out = 500)) + 0.1 * rnorm(500)
res <- sampen(x)
res$value
#> [1] 0.6331877
# }