# Sample Entropy Estimation 1.0.0

(1,503 bytes)

```
A test signal is included in the text file c/sampentest.txt
and the Matlab file matlab/*/sampentest.mat. The sample entropy
calculations are implemented both in Matlab and a command-line
executable obtained from C source code. The following Matlab
session illustrates how to use each method and they give essentially
the same result. Note that the first line of output is Sampen(0,r,N)
which corresponds to m=0 and can be interpreted as the negative
logarithm of the probability of a match of length 1.
>> load sampentest
>> e=sampen(z,5,.2);
>> e
e =
2.1968
2.2251
2.1972
2.1552
2.3150
>> !sampen -m 5 -n -r .2 <sampentest.txt
SampEn(0,0.2,1024) = 2.196818
SampEn(1,0.2,1024) = 2.224817
SampEn(2,0.2,1024) = 2.197225
SampEn(3,0.2,1024) = 2.155202
SampEn(4,0.2,1024) = 2.315008
No matches! SampEn((5,0.2,1024) = Inf
The standard error of the estimates can also be estimated
as shown below.
>> [e,se]=sampen(z,5,.2,1,1,1);
>> [e se]
ans =
2.1968 0.0242
2.2251 0.0430
2.1972 0.0679
2.1552 0.1527
2.3150 0.3356
>> !sampen -m 5 -n -r .2 -v <sampentest.txt
SampEn(0,0.2,1024) = 2.196818 (standard deviation = 0.002685)
SampEn(1,0.2,1024) = 2.224817 (standard deviation = 0.004640)
SampEn(2,0.2,1024) = 2.197225 (standard deviation = 0.007540)
SampEn(3,0.2,1024) = 2.155202 (standard deviation = 0.017693)
SampEn(4,0.2,1024) = 2.315008 (standard deviation = 0.033150)
No matches! SampEn((5,0.2,1024) = Inf (standard deviation = Inf)!
```