###Mr.Bayes
###January 15 2013

###screen -r 14155

###GTR + gamma + proportion of invariable sites

mb

execute Dec23_12_NAKsequences_Bayes.nex

help lset

lset nst=6 rates=invgamma

help lset

showmodel

help mcmc

###Make sure Mcmdiagn is set to yes

mcmcp ngen=10000000

mcmcp diagnfreq=1000

mcmcp relburnin=yes burninfrac=0.25

mcmcp samplefreq=100

mcmc

###Checkfreq is where all parameter values of all chains are printed to a checkpoint file (.ckp). Default is 100,000 generations. If the analysis is stopped prematurely, you can restart it from the last checkpoint using

mcmc append=yes

###As two runs converge onto a stationary distribution, standard deviation of split frequencies should approach zero. (Values can differ slightly due to stochastic effects). 
###average standard deviation below 0.01 - very good. Between 0.01 and 0.05 may be adequate. 

sump

###If the data is 'stationary' than the plot should look like white noise (no tendency of increase or decrease over time).
###In the table: PSRF (potential scale reduction factor) - if values are around 1 we have a good sample of posterior probability distribution. A reasonable goal is to aim for values between 1.00 and 1.02. 

sumt relburnin = yes burninfrac = 0.25

###substitution model parameters are printed to .p file
###topology and branch lengths are printed to a .t file

###During the run: Using Crunch12. So 25000 trees will be discarded as burn-in. So the average standard deviation of split frequencies should be close to zero by the time the 2,500,000 generation is reached (i.e. the 25,000 trees). By  the 70500 generation standard deviation is 0.010343.