Navigation Banner
  next up previous
Next: Exercises Up: Putting It All Together: Previous: Define two likelihood functions

Estimate the P-value via parametric bootstrapping

One can also estimate the P-value using the parametric bootstrap. The statement for simulating a random dataset based on theLikFun is
DataSet simData = SimulateDataSet(theLikFun);
The remaining part of the loop is basically a copy of the original analysis, with variable names adjusted to indicate that they are coming from simulated data. For each simulated dataset we compute the LRT, named simLRT, and compare it to the observed LRT. The estimate of the P-value is the proportion of simulated datasets with a LRT larger than that of the observed data. We simply keep track of the number of such events using the variable count:
simLRT = 2*(simlnLik1-simlnLik0);
if (simLRT > LRT)
{
        count = count+1;
}
and report the results:
fprintf(stdout,"\n\n*** P-value (Parametric BS)= ",count/reps,"\n");

positions.bf provides a good example of the flexibility of Hy-Phy, and many of the same ideas could be used to develop analyses of multiple genes. Of particular importance for multilocus is the ability to mix local and global variables.



Spencer Muse
2000-05-31
 
Sergei L. Kosakovsky Pond and Spencer V. Muse, 1997-2002