A phytools user recently reported discrepant results between brownie.lite and brownieREML.** Both functions fit the multi-rate Brownian evolution model of O'Meara et al. (2006), the former using ML and the latter REML. To fit the model using REML we scale the branches & branch segments of the tree by the rate, and then we compute contrasts and maximize the probability of the contrasts given the rate parameters in our model.
(**Note that brownie.lite & brownieREML are not expected to give exactly the same results. REML should be unbiased, whereas ML is only asymptotically unbiased and will be slightly downwardly biased for small samples. That being said, the results should be quite similar for reasonable sample sizes in each rate regime.)
The bug is that the the order of the data in the input vector x need to be in the order of tree$tip.label, but this is not noted in the documentation and the function does not return an error if this is not the case. Oops.