My last 2 commits are improvements on the earlier 2 commits by Sabrina.
In fit_OU_model, there is still a problem with "refit", because alpha should not be re-estimated. Instead, the shift values should be rescaled: divided by 1-exp(-alpha * age of shift)
Which internal function should be used to find the age of the shifts, given a particular configuration? If you don't already have a specific function to do that, please let me know, and I would be happy to write one. I will probably use pruningwise.branching.times from phylolm for instance.
After this problem is fixed, we can check the distribution of contrasts again.
Thank you Cecile.
generate_design_matrix(tr, "apprX") returns a matrix with ages. So
something like this would do the job.
apply( generate_design_matrix(tr, "apprX")[ ,edgeIndices] , 2, max)
My last 2 commits are improvements on the earlier 2 commits by Sabrina.
In
fit_OU_model
, there is still a problem with "refit", because alpha should not be re-estimated. Instead, the shift values should be rescaled: divided by1-exp(-alpha * age of shift)
Which internal function should be used to find the age of the shifts, given a particular configuration? If you don't already have a specific function to do that, please let me know, and I would be happy to write one. I will probably use
pruningwise.branching.times
fromphylolm
for instance.After this problem is fixed, we can check the distribution of contrasts again.