近似熵的一种快速实用算法

Pincus提出的近似熵算法中有很多冗余的计算,效率低,速度慢,不利于实际应用,洪波等人在定义的基础上引入二值距离矩阵的概率,提出了一种实用快速的算法。

  1. function ApEn=EntropyCompute(sig,m,r0)
  2. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  3. % 计算一维信号的近似熵,采用快速算法
  4. % sig: 待求近似熵的源信号
  5. % m: 一般取 2
  6. % r0: 一般取0.1 ~ 0.25
  7. % Ref: 近似熵:一种应用于短数据的的复杂性度量,杨福生
  8. % 近似熵及其在机械设备故障诊断中的应用,胥永刚
  9. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  10. N = size(sig,1);
  11. r=r0*std(sig);
  12. d=zeros(N,N);
  13. %%% 计算距离矩阵 %%%
  14. for i=1:N
  15. d(i,:)=abs(sig(i)-sig) < r;
  16. end
  17. %%% 计算C2 %%%
  18. c2=zeros(1,N-m+1);
  19. for i=1:N-m+1
  20. for j=1:N-1;
  21. buf = d(i,j) & d(i+1,j+1);
  22. c2(i)=c2(i)+buf;
  23. end
  24. end
  25. Fi(1)=sum(log(c2))/(N-m+1);
  26. m=m+1;
  27. %%% 计算C3 %%%
  28. c3=zeros(1,N-m+1);
  29. for i=1:N-m+1
  30. for j=1:N-2;
  31. c3(i)=c3(i)+(d(i,j) & d(i+1,j+1) & d(i+2,j+2));
  32. end
  33. end
  34. Fi(2)=sum(log(c3))/(N-m+1);
  35. ApEn=Fi(1)-Fi(2);
  36. return;

The algorithm of entropy realization的更多相关文章

  1. A Gentle Introduction to the Gradient Boosting Algorithm for Machine Learning

    A Gentle Introduction to the Gradient Boosting Algorithm for Machine Learning by Jason Brownlee on S ...

  2. Akumuli时间序列数据库——列存储,LSM,MVCC

    Features Column-oriented time-series database. Log-structured append-only B+tree with multiversion c ...

  3. Lempel-Ziv algorithm realization

    Lempel-Ziv 复杂度程序 随着人们对非线性方法的分析越加深入,他们发现,虽然关联维度和最大李雅谱诺夫指数在分析脑电时具有一定的帮助,但是它们对数据的依赖性太强,对干扰和噪 声太敏感,而且要得到 ...

  4. [转载] Calculating Entropy

    From:  johndcook.com/blog For a set of positive probabilities pi summing to 1, their entropy is defi ...

  5. hdu 1053 Entropy

    题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=1053 Entropy Description An entropy encoder is a data ...

  6. ZOJ 3827 Information Entropy 水题

    Information Entropy Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.zju.edu.cn/onlinejudge/sh ...

  7. Reducing the Dimensionality of data with neural networks / A fast learing algorithm for deep belief net

    Deeplearning原文作者Hinton代码注解 Matlab示例代码为两部分,分别对应不同的论文: . Reducing the Dimensionality of data with neur ...

  8. [POJ 1521]--Entropy(哈夫曼树)

    题目链接:http://poj.org/problem?id=1521 Entropy Time Limit: 1000MS    Memory Limit: 10000K Description A ...

  9. ZOJ3827 ACM-ICPC 2014 亚洲区域赛的比赛现场牡丹江I称号 Information Entropy 水的问题

    Information Entropy Time Limit: 2 Seconds      Memory Limit: 131072 KB      Special Judge Informatio ...

随机推荐

  1. Selenium操作滚动条

    //移动到元素element对象的“顶端”与当前窗口的“顶部”对齐 ((JavascriptExecutor) driver).executeScript("arguments[0].scr ...

  2. Qt Widgets、QML、Qt Quick的区别

    Qt Widgets.QML.Qt Quick的区别 简述 看了之前关于 QML 的一些介绍,很多人难免会有一些疑惑: Q1:QML 和 Qt Quick 之间有什么区别? Q2:QtQuick 1. ...

  3. 【洛谷】CYJian的水题大赛【第二弹】解题报告

    点此进入比赛 T1: JerryC Loves Driving 第一题应该就是一道水分题(然而我只水了130分),我的主要做法就是暴力模拟,再做一些小小的优化(蠢得我自己都不想说了). My Code ...

  4. 【SPOJ】Count On A Tree II(树上莫队)

    [SPOJ]Count On A Tree II(树上莫队) 题面 洛谷 Vjudge 洛谷上有翻译啦 题解 如果不在树上就是一个很裸很裸的莫队 现在在树上,就是一个很裸很裸的树上莫队啦. #incl ...

  5. (转)MS14-068域内提权漏洞总结

    0x01 漏洞起源 说到ms14-068,不得不说silver ticket,也就是银票.银票是一张tgs,也就是一张服务票据.服务票据是客户端直接发送给服务器,并请求服务资源的.如果服务器没有向域控 ...

  6. Zend Hash table 详解--转

    原文地址:http://www.phppan.com/2009/12/zend-hashtable/ 在PHP的Zend引擎中,有一个数据结构非常重要,它无处不在,是PHP数据存储的核心,各种常量.变 ...

  7. 【bzoj3170】[Tjoi2013]松鼠聚会

    3170: [Tjoi2013]松鼠聚会 Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 1670  Solved: 885[Submit][Statu ...

  8. Chiaki Sequence Revisited HDU - 6304 lowbit找规律法

    Problem Description Chiaki is interested in an infinite sequence a1,a2,a3,..., which is defined as f ...

  9. Kubernetes 1.5部署sonarqube

    前面几篇博文我们一直在说kubernetes的基础环境的安装及部署.在基础环境部署完成以后,我们开始尝试使用kubernetes来管理我们的应用.本篇博文通过一个简单的示例来向大家展示如何通过depl ...

  10. 「Linux」centos7安装uWSGI

    一定要记得先安装python-devel,再安装uWSGI,否则即使安装成功也是不能使用的,切记切记