Выборочная энтропия
Выборочная энтропия (SampEn; more appropriately K_2 энтропия or корреляционная энтропия Такенса–Грассбергера–Прокаччиа ) is a modification of приблизительной энтропии (ApEn; более точно «энтропия Прокаччиа–Коэна»), используемая для оценки сложности физиологических и других временных рядов signals, diagnosing e.g. diseased states.[1] SampEn has two advantages over ApEn: data length independence and a relatively trouble-free implementation. Also, there is a small computational difference: In ApEn, the comparison between the template vector (see below) and the rest of the vectors also includes comparison with itself. This guarantees that probabilities {\displaystyle C_{i}'^{m}(r)} are never zero. Consequently, it is always possible to take a logarithm of probabilities. Because template comparisons with itself lower ApEn values, the signals are interpreted to be more regular than they actually are. These self-matches are not included in SampEn. However, since SampEn makes direct use of the correlation integrals, it is not a real measure of information but an approximation. The foundations and differences with ApEn, as well as a step-by-step tutorial for its application is available at.[2]
SampEn действительно идентичен «корреляционной энтропии» K_2 Грассбергера и Прокаччиа [3], за исключением того, что в последнем предлагается взять определенные пределы для достижения результата, инвариантного относительно замены переменных. В SampEn такие пределы и свойства инвариантности не рассматриваются.
Существует также многомасштабная версия SampEn, предложенная Костой и другими. [4] SampEn может использоваться в биомедицинских и биомеханических исследованиях, например, для оценки постурального контроля. [5][6]
Определение
Like приблизительной энтропии (ApEn), выборочная энтропия (SampEn) is a measure of сложности.[1] But it does not include self-similar patterns as ApEn does. For a given вложения размерности {\displaystyle m}, допуска {\displaystyle r} and number of точек данных {\displaystyle N}, SampEn is the negative natural логарифм of the того that if two sets of одновременных data points of length {\displaystyle m} have distance {\displaystyle <r} then two sets of simultaneous data points of length {\displaystyle m+1} also have distance {\displaystyle <r}. And we represent it by {\displaystyle SampEn(m,r,N)} (or by {\displaystyle SampEn(m,r,\tau ,N)} including sampling time {\displaystyle \tau }).
Now assume we have a временного ряда data set of length {\displaystyle N={\{x_{1},x_{2},x_{3},...,x_{N}\}}} with a constant time interval {\displaystyle \tau }. We define a template длиной of length {\displaystyle m}, such that {\displaystyle X_{m}(i)={\{x_{i},x_{i+1},x_{i+2},...,x_{i+m-1}\}}} and the distance function {\displaystyle d[X_{m}(i),X_{m}(j)]} (i≠j) is to be the расстоянием Чебышева (но это может быть любая функция расстояния, включая евклидово distance). We define the sample entropy to be
- {\displaystyle SampEn=-\ln {A \over B}}
Где
{\displaystyle A}= количество пар векторов-шаблонов, имеющих{\displaystyle d[X_{m+1}(i),X_{m+1}(j)]<r}
{\displaystyle B}= количество пар векторов-шаблонов, имеющих{\displaystyle d[X_{m}(i),X_{m}(j)]<r}
It is clear from the definition that {\displaystyle A} will always have a value smaller or equal to {\displaystyle B}. Therefore, {\displaystyle SampEn(m,r,\tau )} will be always either be zero or positive value. A smaller value of {\displaystyle SampEn} also indicates more самоподобие in data set or less noise.
Generally we take the value of {\displaystyle m} to be {\displaystyle 2} and the value of {\displaystyle r} to be {\displaystyle 0.2\times std}. Where std stands for стандартное отклонение which should be taken over a very large dataset. For instance, the r value of 6 ms is appropriate for sample entropy calculations of heart rate intervals, since this corresponds to {\displaystyle 0.2\times std} for a very large population.
Многомасштабная выборка
Приведенное выше определение является частным случаем многомасштабного sampEn с , где называется параметром пропуска. В многомасштабном SampEn шаблонные векторы определяются с определенным интервалом между их элементами, заданным значением . Модифицированный шаблонный вектор определяется как , а sampEn можно записать как . И мы вычисляем и , как и раньше.{\displaystyle \delta =1}{\displaystyle \delta }{\displaystyle \delta }{\displaystyle X_{m,\delta }(i)={x_{i},x_{i+\delta },x_{i+2\times \delta },...,x_{i+(m-1)\times \delta }}}{\displaystyle SampEn\left(m,r,\delta \right)=-\ln {A_{\delta } \over B_{\delta }}}{\displaystyle A_{\delta }}{\displaystyle B_{\delta }}
Выполнение
Метод выборочной энтропии легко реализовать во многих различных языках программирования. Ниже приведён пример, написанный на Python.
from itertools import combinations
from math import log
def construct_templates(timeseries_data: list, m: int = 2):
num_windows = len(timeseries_data) - m + 1
return [timeseries_data[x : x + m] for x in range(0, num_windows)]
def get_matches(templates: list, r: float) -> int:
return len(
list(filter(lambda x: is_match(x[0], x[1], r), combinations(templates, 2)))
)
def is_match(template_1: list, template_2: list, r: float) -> bool:
return all([abs(x - y) < r for (x, y) in zip(template_1, template_2)])
def sample_entropy(timeseries_data: list, window_size: int, r: float):
B = get_matches(construct_templates(timeseries_data, window_size), r)
A = get_matches(construct_templates(timeseries_data, window_size + 1), r)
return -log(A / B)
Аналогичный пример на языке Python для численных расчетов.
import numpy
def construct_templates(timeseries_data, m):
num_windows = len(timeseries_data) - m + 1
return numpy.array([timeseries_data[x : x + m] for x in range(0, num_windows)])
def get_matches(templates, r) -> int:
return len(
list(filter(lambda x: is_match(x[0], x[1], r), combinations(templates)))
)
def combinations(x):
idx = numpy.stack(numpy.triu_indices(len(x), k=1), axis=-1)
return x[idx]
def is_match(template_1, template_2, r) -> bool:
return numpy.all([abs(x - y) < r for (x, y) in zip(template_1, template_2)])
def sample_entropy(timeseries_data, window_size, r):
B = get_matches(construct_templates(timeseries_data, window_size), r)
A = get_matches(construct_templates(timeseries_data, window_size + 1), r)
return -numpy.log(A / B)
Пример, написанный на других языках, можно найти здесь:
См. также
Ссылки
- 1 2 Richman, JS; Moorman, JR (2000). «Физиологический анализ временных рядов с использованием приблизительной энтропии и выборочной энтропии». Американский журнал физиологии. Физиология сердца и кровообращения. 278 (6): H2039–49. doi:10.1152/ajpheart.2000.278.6.H2039. PMID 10843903.
- ↑ Delgado-Bonal, Alfonso; Marshak, Alexander (June 2019). «Приближенная энтропия и выборочная энтропия: исчерпывающее руководство». Entropy. 21 (6): 541. Библиографический код:2019Entrp..21..541D. doi:10.3390/e21060541. PMC 7515030. PMID 33267255.
- ↑ Grassberger, Peter; Procaccia, Itamar (1983). "Estimation of the Kolmogorov entropy from a chaotic signal". Physical Review A. 28 (4): 2591(R). Bibcode:1983PhRvA..28.2591G. doi:10.1103/PhysRevA.28.2591.
- ↑ Costa, Madalena; Goldberger, Ary; Peng, C.-K. (2005). "Multiscale entropy analysis of biological signals". Physical Review E. 71 (2) 021906. Bibcode:2005PhRvE..71b1906C. doi:10.1103/PhysRevE.71.021906. PMID 15783351.
- ↑ Błażkiewicz, Michalina; Kędziorek, Justyna; Hadamus, Anna (March 2021). «Влияние визуального ввода и манипуляций с опорной зоной на постуральный контроль у пациентов после остеопоротического перелома позвонка». Entropy. 23 (3): 375. Библиографический код:2021Entrp..23..375B. doi:10.3390/e23030375. PMC 8004071. PMID 33804770.
- ↑ Hadamus, Anna; Białoszewski, Dariusz; Błażkiewicz, Michalina; Kowalska, Aleksandra J.; Urbaniak, Edyta; Wydra, Kamil T.; Wiaderna, Karolina; Boratyński, Rafał; Kobza, Agnieszka; Marczyński, Wojciech (February 2021). «Оценка эффективности реабилитации после операции по полной замене коленного сустава с использованием энтропии образца и классических показателей баланса тела». Энтропия. 23 (2): 164. Бибкод:2021Entrp..23..164H. дои:10.3390/e23020164. ПМЦ 7911395. PMID 33573057.
Источники
- Участники английской Википедии. «Sample entropy». Перевод на русский. CC BY-SA 4.0 (текст и перевод).
