I am having trouble speeding up the following code that I modified from a Maxwell et al (2018) paper. https://www.pnas.org/content/115/19/4891.short
ttrees.ca