How does the approximate entropy function work for a multivariate signal?

7 次查看(过去 30 天)
I am curious about the use of the approximate entropy function in Matlab. I have 838 points that move in three dimensions at equally spaced time intervals, and so far when I input the X,Y,Z coords of these points into the function it gives me an entropy value for each point. This is exactly what I want, but I don't understand how this is being calculated. I see that the the distance between points is being calculated in the formula, so this must have something to do with it? I want to compare my results to Sample Entropy, but the function I see online for SampEn only takes in a 1 dimensional vector.
  2 个评论
the cyclist
the cyclist 2023-11-14
Can you upload the data and your code? You can use the paper clip icon in the INSERT section of the toolbar.
Adam Tyler
Adam Tyler 2023-11-16
移动:the cyclist 2023-11-16
Ok, here is how my code is set up right now. You can see that the Sample Entropy is only set up to take in a 1 x N vector, whereas the MATLAB function calculates the ApEn successfully in 3D. Thank you!

请先登录,再进行评论。

采纳的回答

Pratyush
Pratyush 2023-12-22
Hi Adam,
I understand that you want to know how Approximate Entropy is calculated and how to compare it with Sample Entropy.
Approximate Entropy (ApEn) and Sample Entropy (SampEn) are measures used to quantify the unpredictability and complexity of time-series data. ApEn can be used for multidimensional data like your 3D coordinates by reconstructing a phase space trajectory and calculating the similarity between different states of this trajectory.
Here's a general idea on how ApEn is calculated:
  1. Reconstruct the phase space using the embedding dimension `m` and time delay `τ`.
  2. Compute the Chebyshev distance between states in the phase space.
  3. Set a threshold `r` to determine the similarity between states.
  4. Count the number of similar states for each state.
  5. Calculate the logarithmic frequency of similar states.
  6. Average these logarithms and subtract the average for `m+1` from that for `m` to get ApEn.
You can refer to the documentation for the algorithm: https://in.mathworks.com/help/predmaint/ref/approximateentropy.html#d126e1251
For SampEn, which is typically used for 1D data and does not count self-matches, you can convert your 3D data into a 1D series (e.g., by calculating the magnitude of the vectors) and then apply SampEn to this 1D series. You'll need to define the embedding dimension `m` and a threshold `r`, often a proportion of the standard deviation of your 1D data.
Here's a basic example of how you might convert 3D data to 1D for SampEn analysis in MATLAB:
% Assuming X, Y, Z are column vectors of equal length representing the coordinates
magnitude = sqrt(X.^2 + Y.^2 + Z.^2); % Convert to 1D magnitude time series
% Define parameters for SampEn
m = 2; % Embedding dimension
r = 0.2 * std(magnitude); % Tolerance (often a proportion of the standard deviation)
% Calculate Sample Entropy
sampen_value = sampen(magnitude, m, r);
Hope this helps.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with Signal Processing Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by