The function prints the vector of entropies for each possible action. Depending on printing options, additional information about the probability calculations can be provided.
print_entropy(entropy, digits = 3, print_all = FALSE)
entropy | The entropy measure from |
---|---|
digits | The number of digits to round to. Default 3. |
print_all | If TRUE will print all information on intermediary calculations |
design <- matrix(c(-1, -1, -1, -1, 1, -1, 0, 0, -1, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1), nrow = 4, byrow = TRUE) entropy <- calculate_entropy(design) print_entropy(entropy)#> Shannon's entropy -- Design 1 #> #> A1 A2 A3 A4 A5 #> 0.000 0.477 0.000 0.301 0.413 #> #>print_entropy(entropy, digits = 4)#> Shannon's entropy -- Design 1 #> #> A1 A2 A3 A4 A5 #> 0.0000 0.4771 0.0000 0.3010 0.4127 #> #>print_entropy(entropy, print_all = TRUE)#> Shannon's entropy -- Design 1 #> #> A1 A2 A3 A4 A5 #> 0.000 0.477 0.000 0.301 0.413 #> #> #> The rules-action matrix #> #> Rows: Rules #> Columns: Actions #> #> A1 A2 A3 A4 A5 #> R1 -1 -1 -1 -1 1 #> R2 -1 0 0 -1 0 #> R3 -1 0 -1 0 0 #> R4 0 0 -1 0 -1 #> #> The considered rule is N/A. #> #> The vector of prior probabilities #> #> R1 R2 R3 R4 #> 0.25 0.25 0.25 0.25 #> #> The probability of an action conditional on a rule #> #> A1 A2 A3 A4 A5 #> R1 0.000 0.000 0.000 0.000 1.000 #> R2 0.000 0.333 0.333 0.000 0.333 #> R3 0.000 0.333 0.000 0.333 0.333 #> R4 0.333 0.333 0.000 0.333 0.000 #> #> The probability of a rule conditional on observing an action, i.e. the posterior #> #> A1 A2 A3 A4 A5 #> R1 0 0.000 0 0.0 0.6 #> R2 0 0.333 1 0.0 0.2 #> R3 0 0.333 0 0.5 0.2 #> R4 1 0.333 0 0.5 0.0 #> #>