richelbilderbeek / Cer2016

Community Ecology Research course 2016
GNU General Public License v3.0
1 stars 0 forks source link

Add nLTT statistic to vignette `worked_out_examples` #21

Closed richelbilderbeek closed 8 years ago

richelbilderbeek commented 8 years ago

At the end of the worked-out example 1, it shows two different nLTT lines: (1) the 'true' nLTT line, and (2) the average posterior nLTT line. The nLTT statistic equals the surface between these two lines.

Too bad, nLTT::nLTTstat cannot be used here, as it takes two phylogenies as its inputs.

What can be done is the obtain the ribir::get_nltt_values for both 'true' phylogeny and average posterior and subtract these.

t nLTT true nLTT average posterioir absolute difference
0.0 0.1 0.2 0.1
0.1 0.2 0.3 0.1
0.2 0.3 0.5 0.2
0.3 0.5 0.6 0.1

The sum of the absolute differences is the nLTT stat.

Write a function called get_nltt_stat, like

#' Obtain the nLTT statistic between the average of phylogenies_a and the average of phylogenies_b
get_nltt_stat <- function(phylogenies_a, phylogenies_b) {
}

Test that it results in 0.0 for equal phylogenies.

Write a vignette that demonstrates this.

richelbilderbeek commented 8 years ago

Works in vignette:

1 2 3 4

richelbilderbeek commented 8 years ago

Works since 084933a5c13719c58a4340e695d689885c19abbf