knitr::opts_chunk$set(echo = TRUE) library(dmea02)
functions
sim.tree
to simulate treesphylo2vectors
to convert a phylo into the set of vectors characterizing the trees = sim.tree(ct=6) plot(s$phylo) s$tree phylo2vectors(s$phylo) all.equal(s$tree$wt,phylo2vectors(s$phylo)$wt) all.equal(s$tree$E,phylo2vectors(s$phylo)$E) all.equal(s$tree$n,phylo2vectors(s$phylo)$n)
to do:
phylo2vectors
does not give the vector S corresponding to topology. add itsim.tree
using its = sim.tree(ct=2,seed=5) plot(s$phylo) s2=phylo2vectors(s$phylo) s2 s$tree up = update.tree(s2,0.5,1.5) up
s <- sim.tree() plot(s$phylo) plot(vectors2phylo(s$tree)) all.equal(s$phylo,vectors2phylo(s$tree))
s = sim.tree(ct=6) plot(s$phylo.extant) rec = rec.tree(tree=s$tree.extant,pars=c(0.8,0.1,40)) plot(vectors2phylo(rec)) s$tree.extant rec
s = sim.tree(seed = 1) mle.tree(s$tree) tree = s$tree.extant st = sim.srt(tree,pars=c(0.8,0.1,40),n_trees=100) mle.st(st)
library(dmea) n_sim = 537 n_trees = 10 MP = matrix(nrow=n_sim,ncol=3) RP = matrix(nrow=n_sim,ncol=3) p = proc.time() for(i in 1:n_sim){ est = sim.est(n_trees=n_trees,pars=c(0.8,0.1,40),seed=i) RP[i,] = est$real MP[i,] = est$est } print(proc.time()-p) par_est_vis(P=MP,par=1,PR=RP) par_est_vis(P=MP,par=2,PR=RP) par_est_vis(P=MP,par=3,PR=RP)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.