Comments (9)
The way you have things set up looks OK to me, and indeed leaving at least one rate fixed (to 1) makes everything identifiable.
What I tried to point out is that in a rate matrix for N states, there are N*N entries in the rate matrix, but N+1 of them are not free: N on the diagonal and 1 because of the normalisation. So, for binary data, N=2, leaving just 1 degree of freedom. But since you have more sources of information for α and β this restriction does not apply in your case: α and β are identifiably for their individual sites, so having another rate matrix as function of α and β should not be a problem.
Anyway, let me know if you need any help implementing these substitution models or the constraints you want to put on parameters.
from beast2.
I may need your help in implementing these changes. I'm working with @rbturnbull on this, and he's more experienced in adding features to BEAST than I am, but it would also be a valuable skill for me to learn, so any help would be appreciated!
from beast2.
There is no convenient way to do this as far as I am aware off other than write a few classes and put them in a package. I am happy to assist if that seems too complicated.
One thing to be aware of in the example you gave is that there is only a single degree of freedom in the binary "general" substitution model: rates are normalised to give an expected rate of 1, so α and β are not identifiable and perhaps parameterising as
-α α
1-α -1+α
and restricting α to be in the range 0 to 0.5 could be an alternative to ensure the α<β.
from beast2.
@rbouckaert What I have in mind is that the rate parameters α, β, etc. would be common over all sites. (Ideally, we would have one copy of each such parameter per branch, as we do for branch length, but this may be too complex, so making the rate variables global over all sites and branches would also be acceptable.) In this case, if I have at least one site whose substitution matrix contains a 1, would this allow us to determine the rate parameters even at sites whose matrices contain only parameters?
For example, say at site 1 we have the matrix
-α α
α+β -α-β
at site 2, we have
-α α
α -α
and at site 3 we have
-β-1 β 1
β -2β β
1 β -β-1
Since the values assigned to α and β are assumed to hold over all sites, will the first two substitution models work as they are, or will normalization still pose a problem?
from beast2.
Hi @jjmccollum and @rbouckaert - this all looks good to me. I'm happy to work with @jjmccollum on this and we'll see how we go. We might have questions in the future.
from beast2.
It looks like we might already be able to encode rate parameter combinations in substitution model matrices using RPNcalculator
. For the matrix
-1 1
Clar_rate + Byz_rate -Clar_rate - Byz_rate
the XML
<parameter spec="parameter.CompoundValuable" id="rates.character1" name="rates">
<!-- Start rate vars -->
<var idref="default_rate"/>
<var spec="RPNcalculator" expression="Clar_rate Byz_rate +">
<parameter idref="Clar_rate"/>
<parameter idref="Byz_rate"/>
</var>
<!-- End rate vars -->
</parameter>
appears to work; at the very least, it is not raising any exceptions when I input the XML to BEAST.
from beast2.
Related Issues (20)
- Solving ambiguous assertion in InputForAnnotatedConstructorTest HOT 12
- BEAUTi 2 fails to launch apps HOT 3
- need getter in XMLParser
- BEAST does not launch with many packages installed HOT 2
- Loading XML back into BEAUti seems to break things HOT 4
- XMLProducer fails to populate "required" field
- Prep for v2.7.3 release HOT 1
- Sample from Prior : one or more traces contain invalid values and are not able to be displayed HOT 1
- ThreadedTreeLikelihood should have rootFrequencies input HOT 1
- beast2 only usable wich OpenCL HOT 4
- PackageManager -dir does not alter installation directory HOT 6
- command line packagemanager issue with fresh install
- ConstantSitesAlignment HOT 2
- TreeParser does not seem to correctly initialise m_storedNodes
- Unicode (UTF-8) input support for BEAST XML inputs HOT 11
- Sequence.initProbabilities assumes all sites have the same number of states HOT 2
- PackageManager should install BEAST.base if not present
- java.lang.IllegalArgumentException: n must be positive HOT 1
- beast 2 package guide out of date HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from beast2.