|
|
||
|
Next: Molecular Clocks Up: Imposing constraints on variables Previous: Imposing constraints on variables Simple Constraints: relrate.bfThe primary reason for developing Hy-Phy was to provide a system for performing likelihood analyses on molecular evolutionary data sets. In particular, we wanted to be able to describe and perform likelihood ratio tests (LRTs) easily. In order to perform an LRT it is first necessary to describe a constraint, or series of constraints, among parameters in the probability model. To illustrate the syntax of parameter constraints in Hy-Phy, examine the code in relrate.bf:
SetDialogPrompt("Select a nucleotide data file:");
DataSet myData = ReadDataFile (PROMPT_FOR_FILE);
DataSetFilter myFilter = CreateFilter (myData,1);
HarvestFrequencies (obsFreqs, myFilter, 1, 1, 1);
F81RateMatrix =
{{* ,mu,mu,mu}
{mu,* ,mu,mu}
{mu,mu,* ,mu}
{mu,mu,mu,* }};
Model F81 = (F81RateMatrix, obsFreqs);
Tree myTree = (a,b,og);
fprintf(stdout,"\n Unconstrained analysis:\n\n");
LikelihoodFunction theLikFun = (myFilter, myTree, obsFreqs);
Optimize (paramValues, theLikFun);
fprintf (stdout, theLikFun);
fprintf(stdout,"\n\n\n Constrained analysis:\n\n");
myTree.a.mu := myTree.b.mu;
Optimize (paramValues, theLikFun);
fprintf (stdout, theLikFun);
Spencer Muse 2000-05-31 |
Sergei L. Kosakovsky Pond and Spencer V. Muse, 1997-2002
|
|