Matlab:熵与数字化代码长度的关系图 [英] Matlab : Plot of entropy vs digitized code length

查看:102
本文介绍了Matlab:熵与数字化代码长度的关系图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[帐篷图] [1]是时间上离散的动态系统.地图的迭代产生一个时间序列.

[Tent Map][1] is a dynamical system that is discrete in time. Iterations of the map yields a time series.

当使用阈值= 0.5在0/1中离散化时,该系统的熵约为H = log_2(2)= 0.69.我想获得一个图,其中Y轴为熵,X轴为样本数或时间序列的长度.我已经编写了通过改变时间序列的长度来使熵变大的代码.目的是查看离散时间序列的长度为多少,得到熵H.但是,代码无限循环,并且从未达到熵值H.有人可以帮忙获得图形吗?谢谢.

The entropy of this system when discretized in 0/1 using a threshold = 0.5 is, H = log_2(2) = 0.69 approx. I want to obtain a graph with Y Axis as the entropy and X Axis as the Number of samples or the length of the time series. I have written a code for obatining the entropy by varying the length of the time series. The objective is to see at what length of the discretized time series, I get the entropy H. The code however, loops infinitely and never reaches the entropy value H. Can somebody please help in obtaining the graph? Thank you.

  [1]: https://en.wikipedia.org/wiki/Tent_map

推荐答案

您是说lambda必须完全等于log(2).当熵降到log(2)以下时,它会跳过该值(例如,不是完全是log(2),可能是0.69309的迭代,该值较小).尝试更换线

You are saying that lambda must be EXACTLY equal to log(2). When the entropy drops below log(2) it skips over this value (for instance instead of exactly log(2) maybe an iteration is 0.69309 which is less). Try replacing the line

while(lambda ~=H)

使用

tol=0.01;
while(~(abs(lambda-H)<tol))

这意味着只要lambda接近H(公差为tol),它就会退出.

this will mean that it quits whenever lambda is close to H (with in the tolerance tol).

如果您的tol太小(尝试0.001),则迭代将再次跳过它,您将回到以前遇到的问题.

If your tol is too small (try 0.001) an iteration would jump over it again and you would be back to the problem you had before.

这篇关于Matlab:熵与数字化代码长度的关系图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆