dnPhyloCTMCDASiteIID - Data augmentation-based phylogenetic continuous-time Markov chain distribution
with independent and identically distributed sites
| tree : | Tree (pass by const reference) |
| The tree along which the process evolves. | |
| Q : | RateGenerator (pass by const reference) |
| The global or branch-specific rate matrices. | |
| rootFrequencies : | Simplex (pass by const reference) |
| The root specific frequencies of the characters, if applicable. | |
| Default : NULL | |
| branchRates : | RealPos (pass by const reference) |
| The global or branch-specific rate multipliers. | |
| Default : 1 | |
| siteRates : | RealPos[] (pass by const reference) |
| The rate categories for the sites. | |
| Default : [ ] | |
| pInv : | Probability (pass by const reference) |
| The probability of a site being invariant. | |
| Default : 0 | |
| nSites : | Natural (pass by value) |
| The number of sites, used for simulation. | |
| Default : 10 | |
| type : | String (pass by value) |
| The data type, used for simulation and initialization. | |
| Default : DNA | |
| Options : DNA|RNA|AA|PoMo|Protein|Standard|NaturalNumbers|Restriction | |
| treatAmbiguousAsGap : | Bool (pass by value) |
| Should we treat ambiguous characters as gaps/missing? | |
| Default : FALSE | |
| coding : | String (pass by value) |
| Default : all |
# Read character data from a file
chars <- readDiscreteCharacterData("myData.nex")
taxa = chars.taxa()
# Draw a tree with branch lengths
tree ~ dnUniformTopologyBranchLength( taxa, branchLengthDistribution=dnExp(10.0) )
# Define a rate matrix
q_matrix <- fnJC(4)
rf <- rep(1/4, 4)
# Create stochastic node with the tip distribution given by `tree` and `q_matrix`
x ~ dnPhyloCTMCDASiteIID(tree = tree, Q = q_matrix, rootfrequencies=rf)
char_hist := x.characterHistories()
# Clamp observed characters to the node
x.clamp(chars)
# Calculate the probability of the observed characters under the given distribution
x.lnProbability()