Entropy
更多信息和选项
- Entropy 是衡量数据变化(信息量大小)的指标.
- data 可采用以下形式和解释:
-
{x1,x2,…} 数值或符号组成的列表 » » string 字符串 String 中的字符列表 string » WeightedData 带有权重的数值列表 » TimeSeries, TemporalData 数值向量或数组(忽略时间戳) » - Entropy[k,{x1, …}] 等价于 -
piLog[k,pi],其中 pi 是不同元素 xi 出现的比例. » - 可给出以下选项:
-
SameTest Automatic 用于测试表达式是否相等的函数 » -
SameTest Automatic 用于测试表达式是否相等的函数 » - Entropy[data,SameTestf] 对数据元素对应用 f 以确定它们是否应被视为等价.
范例
打开所有单元 关闭所有单元基本范例 (3)
Entropy[{0, 1, 1, 4, 1, 1}]Entropy["A quick brown fox jumps over the lazy dog"]%//NEntropy[{a, b, b, c, c, c, c}]七个元素中有一个出现了一次,另一个出现了两次,第三个则出现了四次:
-1 / 7Log[1 / 7] - 2 / 7Log[2 / 7] - 4 / 7Log[4 / 7] == %范围 (4)
list = RandomInteger[1, 1000];Counts[list]Entropy[list]%//NWeightedData 的熵:
data = {0, 1, 1, 4, 1, 1};
weights = {3, 1, 1, 1, 1, 1};Entropy[WeightedData[data, weights]]//SimplifyEntropy[data]//SimplifyN /@ {%, %%}计算 TimeSeries 的熵:
ts = TemporalData[TimeSeries, {{{5, 4, 5, 6, 3, 3, 3, 6, 6, 6, 3, 3, 3, 6, 6, 6, 3, 6, 4, 4, 6, 6, 4, 5,
3, 5, 3, 4, 5, 6, 5, 3, 6, 3, 6, 5, 5, 4, 3, 5, 3, 5, 4, 5, 3, 3, 4, 6, 4, 5, 6, 5, 3, 4, 6, 4,
5, 3, 3, 6, 4, 4, 3, 4, 6, 3, 3, 4, 3, 3, ... , 4, 5,
4, 3, 3, 3, 3, 3, 6, 4, 4, 5, 5, 3, 3, 4, 4, 5, 3, 4, 3, 4, 6, 3}}, {{1, 174, 1}}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}, ValueDimensions -> 1}}, False,
14.3];ListPlot[ts]Entropy[ts]Entropy[ts["Values"]]%% - %//Simplifylist = {0, 1, 1, 4, 1, 1};Entropy[10, list]//SimplifyEntropy[2, list]//SimplifyEntropy[E, list] == Entropy[list]选项 (1)
应用 (2)
list1 = {0, 1, 1, 0, 0, 1, 1};
list2 = {1, 2, 3, 4, 5, 6, 7};N[Entropy /@ {list1, list2}]计算速率为
的 TelegraphProcess 路径的熵:
μ = 1.3;
data = RandomFunction[TelegraphProcess[μ], {1, 10 ^ 2}]ListPlot[data]Entropy[data]N[%]属性和关系 (3)
Entropy[{1, 2, 3, 4}]Entropy[{x, y, z, w}]Entropy["star"]list = RandomInteger[3, 100]probs = Values[Counts[list]] / Length[list]-Total[probs Log[probs]]Entropy[list] - %//FullSimplifystring = "A quick brown fox jumps over the lazy dog";Entropy[string]Characters[string]Entropy[%]%%% - %//Simplify可能存在的问题 (1)
巧妙范例 (2)
Entropy[ExampleData[{"Text", "Hamlet"}]]//Short%//NEntropy[ExampleData[{"Text", "ShakespearesSonnets"}]]//Nunhr = Select[ExampleData["Text"], StringContainsQ[#[[2]], "UNHumanRights"]&];unhr//Shortlabels = Map[Style[StringDrop[#, 13], 9]&, unhr[[All, 2]]];BarChart[Map[N@Entropy[ExampleData[#]]&, unhr], ChartLabels -> Placed[labels, After], BarOrigin -> Left, ColorFunction -> Function[{height}, ColorData["IslandColors"][1 - height]]]相关指南
-
▪
- 描述性统计分析
文本
Wolfram Research (2008),Entropy,Wolfram 语言函数,https://reference.wolfram.com/language/ref/Entropy.html.
CMS
Wolfram 语言. 2008. "Entropy." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/Entropy.html.
APA
Wolfram 语言. (2008). Entropy. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/Entropy.html 年
BibTeX
@misc{reference.wolfram_2026_entropy, author="Wolfram Research", title="{Entropy}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/Entropy.html}", note=[Accessed: 10-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_entropy, organization={Wolfram Research}, title={Entropy}, year={2008}, url={https://reference.wolfram.com/language/ref/Entropy.html}, note=[Accessed: 10-September-2026]}