The function is a wrapper for calc_entropy
and is meant for
external use by the user. The goal for the decision maker is
to choose an action such that the observer is left as clueless as possible
as to which rule governs his actions, i.e. maximize entropy.
calculate_entropy(design, priors = NULL)
design | A matrix with rows equal to the number of rules and columns equal to the number of actions or a list of such matrices. |
---|---|
priors | A vector of prior values. If the design is a list of matrices, priors can be a matrix with rows equal to the length of the design and columns equal to the number of rules. |
A list of of vectors of entropies for each possible action with the following attributes:
design
priors
pr_aj_rk
pr_rk_aj
design <- matrix(c(-1, -1, -1, -1, 1, -1, 0, 0, -1, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1), nrow = 4L, byrow = TRUE) calculate_entropy(design)#> [[1]] #> A1 A2 A3 A4 A5 #> 0.000000 0.477121 0.000000 0.301030 0.412697 #> attr(,"design") #> [,1] [,2] [,3] [,4] [,5] #> [1,] -1 -1 -1 -1 1 #> [2,] -1 0 0 -1 0 #> [3,] -1 0 -1 0 0 #> [4,] 0 0 -1 0 -1 #> attr(,"priors") #> R1 R2 R3 R4 #> 0.25 0.25 0.25 0.25 #> attr(,"pr_aj_rk") #> A1 A2 A3 A4 A5 #> R1 0.000000 0.000000 0.000000 0.000000 1.000000 #> R2 0.000000 0.333333 0.333333 0.000000 0.333333 #> R3 0.000000 0.333333 0.000000 0.333333 0.333333 #> R4 0.333333 0.333333 0.000000 0.333333 0.000000 #> attr(,"pr_rk_aj") #> A1 A2 A3 A4 A5 #> R1 0 0.000000 0 0.0 0.6 #> R2 0 0.333333 1 0.0 0.2 #> R3 0 0.333333 0 0.5 0.2 #> R4 1 0.333333 0 0.5 0.0 #>