Welcome, Guest. Please Login
YaBB - Yet another Bulletin Board
 
  HomeHelpSearchLogin  
 
Multiple Substitution Matrices along a Phylogeny (Read 2321 times)
Miguel Lacerda
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 36
Natl Univ of Ireland, Galway
Gender: male
Multiple Substitution Matrices along a Phylogeny
Oct 19th, 2008 at 2:46pm
 
Hi Sergei,

Would you mind taking a look at the attached code please? I have set up a model with two rate matrices; the first is called SubsMatrixM1 and applies to branches leading to leaf nodes, whilst the other is called SubsMatrixM2 and applies to branches leading to ancestral nodes. In this code, I have two parameters which I am estimating, w0 and p0 which should be around 0.1 and 0.5 respectively when SubsMatrixM1 = SubsMatrixM2 (I simulated the attached data as such).

In the attached code, I have made SubsMatrixM1 and SubsMatrixM2 identical (or at least I think I have!!) which is the same as just having one substitution process along all branches. The problem is that setting up my models as:

Model M1 = (SubsMatrixM1, EFV, 1);
Model M2 = (SubsMatrixM2, EFV, 1);

gives me incorrect values for the parameters I am estimating, whereas:

Model M1 = (SubsMatrixM1, EFV, 1);
Model M2 = (SubsMatrixM1, EFV, 1);
/* both use SubsMatrixM1 */

OR:

Model M1 = (SubsMatrixM2, EFV, 1);
Model M2 = (SubsMatrixM2, EFV, 1);
/* both use SubsMatrixM2 */

give me the same and correct values for the parameters! How is this possible?

Thanks so much for your help!

Miguel


Back to top
 
Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login (55 KB | )
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: Multiple Substitution Matrices along a Phylogeny
Reply #1 - Oct 20th, 2008 at 5:11pm
 
Dear Miguel,

Because you have two independent category variables in your models (omegaM1 and omegaM2), even when you constrain their hyper-parameters to be the same, the model will still be different from a single model scenario. This is because omegaM1 and omegaM2 will both be integrated out in the mixed model, hence you will have NINE (not 3) rate categories, with a 3x3 joint distribution. You want omegaM1 and omegaM2 to be perfectly correlated. For that, you need to define omegaM2 conditionally on omegaM1, as follows:

Code:
categFreqMatrixM2 = {{1,0,0}{0,1,0}{0,0,1}};
categRateMatrixM2 = {{w0, 1, w2}};

category omegaM2 = (3, categFreqMatrixM2, MEAN, omegaM1, categRateMatrixM2, 0, 1e25);
 



The frequency matrix is now a covariance matrix (i.e. the k-th row is the conditional distribution of omegaM2 given that omegaM1 has taken on it's k-th value) and the construction of omegaM2 now uses omegaM1 in place of its density argument to specify that omagaM2 conditionally depends on omegaM1.

Cheers,
Sergei


Back to top
 

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged
 
Miguel Lacerda
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 36
Natl Univ of Ireland, Galway
Gender: male
Re: Multiple Substitution Matrices along a Phylogeny
Reply #2 - Oct 21st, 2008 at 1:49am
 
Oh, that makes sense!

Thanks a lot for your help,

Miguel
Back to top
 
 
IP Logged