Skip to contents

Accuracy is defined as the proportion of correctly assigned ancestries across the posterior sample.

Usage

get_accuracy(out, true_tree)

Arguments

out

An object of class outbreaker_chains.

true_tree

A data frame with the true transmission tree, including 'from' and 'to' columns.

Value

A numeric vector of accuracy values for each posterior tree.

Examples

true_tree <- data.frame(from = as.character(outbreaker2::fake_outbreak$ances), to = linelist$id)
get_accuracy(out, true_tree)
#>   [1] 0.7333333 0.8000000 0.8333333 0.8000000 0.7666667 0.8666667 0.9000000
#>   [8] 0.8666667 0.9000000 0.9000000 0.8666667 0.8666667 0.8666667 0.8666667
#>  [15] 0.8333333 0.8666667 0.8666667 0.8666667 0.9000000 0.9000000 0.8666667
#>  [22] 0.9000000 0.8333333 0.8666667 0.9000000 0.8666667 0.9000000 0.8333333
#>  [29] 0.8333333 0.8000000 0.9000000 0.9000000 0.8666667 0.8333333 0.8000000
#>  [36] 0.8666667 0.8666667 0.9000000 0.9000000 0.8666667 0.9000000 0.8666667
#>  [43] 0.9000000 0.9000000 0.9000000 0.9000000 0.9000000 0.9000000 0.9000000
#>  [50] 0.8333333 0.8666667 0.9000000 0.8666667 0.8666667 0.8666667 0.9000000
#>  [57] 0.8666667 0.8666667 0.8666667 0.9000000 0.8666667 0.9000000 0.8333333
#>  [64] 0.8333333 0.9000000 0.9000000 0.9000000 0.9000000 0.8666667 0.8666667
#>  [71] 0.9000000 0.9000000 0.8666667 0.8666667 0.9000000 0.9000000 0.9000000
#>  [78] 0.9000000 0.9000000 0.8333333 0.9000000 0.9000000 0.8666667 0.8666667
#>  [85] 0.9000000 0.8666667 0.9000000 0.9000000 0.8666667 0.8666667 0.9000000
#>  [92] 0.9000000 0.8666667 0.8666667 0.9000000 0.9000000 0.9000000 0.8666667
#>  [99] 0.8666667 0.8666667 0.9000000 0.8666667 0.8333333 0.9000000 0.9000000
#> [106] 0.8666667 0.9000000 0.8666667 0.8666667 0.8666667 0.8666667 0.9000000
#> [113] 0.9000000 0.9000000 0.9000000 0.8666667 0.8666667 0.8666667 0.8333333
#> [120] 0.8666667 0.9000000 0.8666667 0.8666667 0.9000000 0.9000000 0.8666667
#> [127] 0.8333333 0.9000000 0.9000000 0.8333333 0.9000000 0.9000000 0.9000000
#> [134] 0.8333333 0.8666667 0.9000000 0.8666667 0.8666667 0.8333333 0.8666667
#> [141] 0.9000000 0.8666667 0.9000000 0.8333333 0.8333333 0.8666667 0.8666667
#> [148] 0.9000000 0.9000000 0.9000000 0.8666667 0.8666667 0.9000000 0.8666667
#> [155] 0.8333333 0.8333333 0.9000000 0.8666667 0.9000000 0.9000000 0.8666667
#> [162] 0.8666667 0.9000000 0.9000000 0.9000000 0.9000000 0.8666667 0.8666667
#> [169] 0.9000000 0.8333333 0.9000000 0.8666667 0.9000000 0.8333333 0.8666667
#> [176] 0.8666667 0.9000000 0.9000000 0.8333333 0.9000000 0.9000000 0.9000000
#> [183] 0.8666667 0.8333333 0.8333333 0.8333333 0.8666667 0.8666667 0.9000000
#> [190] 0.9000000 0.9000000 0.8666667 0.9000000 0.8333333 0.8666667 0.8666667
#> [197] 0.8666667 0.9000000 0.9000000 0.8666667 0.8666667