entropy: Standard measures of complexity for strings

Description Usage Arguments Details Value References Examples

View source: R/standard_complexity.R

Description

Functions to compute different measures of complexity for strings: Entropy, Second-Order Entropy, and Change Complexity

Usage

1
2
3
4
5
entropy(string)

entropy2(string)

change_complexity(string)

Arguments

string

character vector containing the to be analyzed strings (can contain multiple strings for the entropy measures).

Details

For users who need advanced functions, a comprehensive package computing various versions of entropy estimators is available entropy. For users who just need first and second-order entropy and which to apply them to short string, the acss package provides two functions: entropy (first-order entropy) and entropy2 second-order entropy.

Change complexity (change_complexity) assesses cognitive complexity or the subjective perception of complexity of a binary string. It has been comprehensively defined by Aksentijevic and Gibson (2012). Although the algorithm will work with any number of symbols up to 10, the rationale of Change Complexity only applies to binary strings.

Value

numeric, the complexity of the string. For entropy and entropy2 of the same length as string. change_complexity currently only works with inputs of length 1.

References

Aksentijevic & Gibson (2012). Complexity equals change. Cognitive Systems Research, 15-17, 1-16.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
strings1 <- c("010011010001", "0010203928837", "0000000000")
strings2 <- c("001011", "01213", "010101010101")

entropy(strings1)
entropy("XYXXYYXYXXXY") # "same" string as strings1[1]
entropy(c("HUHHEGGTE", "EGGHHU"))

entropy2(strings1)
entropy2("XYXXYYXYXXXY")

entropy2(strings2)

change_complexity(strings1)
change_complexity("XYXXYYXYXXXY")

acss documentation built on May 29, 2017, 10:40 a.m.

Related to entropy in acss...