-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimising molecular model parameters #3
Comments
I've made a start on this here: 362e3db Now Trees (the struct) initialise with default rate parameters Lines 6 to 10 in 362e3db
Lines 19 to 42 in 362e3db
Now the update.likelihood method uses the internal tree rate matrix so we can make changes to the rate paramters, update the matrix, and then update the likelihood. A problem I might need your help with is the phyML test. If you run the test now it passes, even though the call to phyML specifies for it to use the JC69 model Line 53 in 362e3db
If you swap the JC69 to GTR then the test fails because the likelihoods are different. Any ideas why? As far as I can tell I have constructed the default rate matrix to be the same as the one that phyML uses.
|
So phyml with JC69 matches your code with GTR? Or they match when both JC69, and mismatch when both GTR? Can't immediately spot anything obviously wrong in the rates, but will take a closer look soon |
A rust thing: I wonder if we might want a |
I think what I don't quite understand is why this should change the likelihood at all. GTR vs JC69 are ways of parameterising the matrix right? So if I choose parameters in each model that produce a matrix with the same values then the likelihood of the tree should be the same? Before I was explicitly defining a rate matrix
Then I calculate the tree likelihood as normal by exponentiating this rate matrix. This produce a likelihood that matched with phyML set to JC69 mode so I'd imagine phyML uses this as the default (I think this corresponds to the 1 parameter in JC69 = 4/3 ?). Now I've added a function so that we no longer define However, when you set phyML to use GTR it produces a different likelihood to my code. So possibly it just has a different default set of GTR parameters that produce a different rate matrix and therefore different likelihood. |
Implemented this here: https://github.com/bacpop/trees_rs/blob/main/src/rate_matrix.rs |
Shout out @mattjohnruss |
Between topology optimisation, want to optimise the rate matrix parameters.
Ultimately we want:
Maybe a helpful reference: https://github.com/4ment/phylostan
Also see models here: http://www.iqtree.org/doc/Substitution-Models#dna-models and http://www.iqtree.org/doc/Substitution-Models#binary-and-morphological-models
The text was updated successfully, but these errors were encountered: