I agree with Sanantha Raj's question.
Pincus defines ApEn in PNAS, 1991, with equations 1, 6, and 10. Equation 6 indicates that one should take the sum of the logs, rather than the log of the sum. But the equation used in approx_entropy.m is consistent with the equation given by Moody at http://www.physionet.org/physiotools/ApEn/. Can you explain the discrepancy?
Comment only
12 Nov 2014
Approximate Entropy
This function computes approximate entropy of a data series.
Hi,
It looks like you are computing the Sample Entropy rather than the Approximate entropy.
I am new to this area and this is what I feel in my first observation. Correct me if I am wrong.
I say it is algorithm of Sample Entropy because you take logarithm of the ratio at the end rather than at the counter itself before calculation Correlation.
Pedro, thanks for the suggestion. I tried bsxfun when I first wrote this and it was not faster at that time. Perhaps things have changed so i will revisit it.
Thanks for this functions. It was very helpfull.
I would just remocomend the use of bsxfun instead of repmat, simpy because it's faster. The equivalent would be I believe:
[i, j] = find(bsxfun(@le, min(x1(1:end-1),x1(2:end)), max(x2(1:end-1),x2(2:end)).') & ...
bsxfun(@ge, max(x1(1:end-1),x1(2:end)), min(x2(1:end-1),x2(2:end)).') & ...
bsxfun(@le, min(y1(1:end-1),y1(2:end)), max(y2(1:end-1),y2(2:end)).') & ...
bsxfun(@ge, max(y1(1:end-1),y1(2:end)), min(y2(1:end-1),y2(2:end)).'));
Thanks again, Pedro
Comment only