For 10 trees?
library(dmea)
set.seed(128)
s = sim_phyl()
#plot(s$newick)
s2 = drop.fossil(s$newick)
s2 = phylo2p(s2)
wt = s2$t
n_trees = 100
pars = c(0.8,0.0175,0.1)
p = proc.time()
S = sim_srt(wt=wt, pars=pars, parallel=F, n_trees=n_trees)
print(proc.time()-p)
## user system elapsed
## 5.876 0.016 5.893
p = proc.time()
pars = subplex(par = pars, fn = llik_st , setoftrees = S)
print(proc.time()-p)
## user system elapsed
## 2.952 0.000 2.953
For 1000 trees?
library(dmea)
set.seed(128)
s = sim_phyl()
#plot(s$newick)
s2 = drop.fossil(s$newick)
s2 = phylo2p(s2)
wt = s2$t
n_trees = 1000
pars = c(0.8,0.0175,0.1)
p = proc.time()
S = sim_srt(wt=wt, pars=pars, parallel=F, n_trees=n_trees)
print(proc.time()-p)
## user system elapsed
## 57.696 0.004 57.701
p = proc.time()
pars = subplex(par = pars, fn = llik_st , setoftrees = S)
print(proc.time()-p)
## user system elapsed
## 32.612 0.000 32.616
For 1000 parallel?
library(dmea)
set.seed(128)
s = sim_phyl()
#plot(s$newick)
s2 = drop.fossil(s$newick)
s2 = phylo2p(s2)
wt = s2$t
n_trees = 1000
pars = c(0.8,0.0175,0.1)
p = proc.time()
S = sim_srt(wt=wt, pars=pars, parallel=T, n_trees=n_trees)
print(proc.time()-p)
## user system elapsed
## 0.616 0.028 40.093
p = proc.time()
pars = subplex(par = pars, fn = llik_st , setoftrees = S)
print(proc.time()-p)
## user system elapsed
## 29.084 0.000 29.086
For 10000 trees?
library(dmea)
set.seed(128)
s = sim_phyl()
#plot(s$newick)
s2 = drop.fossil(s$newick)
s2 = phylo2p(s2)
wt = s2$t
n_trees = 10000
pars = c(0.8,0.0175,0.1)
p = proc.time()
S = sim_srt(wt=wt, pars=pars, parallel=F, n_trees=n_trees)
print(proc.time()-p)
## user system elapsed
## 571.352 0.060 571.430
p = proc.time()
pars = subplex(par = pars, fn = llik_st , setoftrees = S)
print(proc.time()-p)
## user system elapsed
## 437.044 0.972 438.579
For 10000 parallel?
library(dmea)
set.seed(128)
s = sim_phyl()
#plot(s$newick)
s2 = drop.fossil(s$newick)
s2 = phylo2p(s2)
wt = s2$t
n_trees = 10000
pars = c(0.8,0.0175,0.1)
p = proc.time()
S = sim_srt(wt=wt, pars=pars, parallel=T, n_trees=n_trees)
print(proc.time()-p)
## user system elapsed
## 5.952 0.132 387.399
p = proc.time()
pars = subplex(par = pars, fn = llik_st , setoftrees = S)
print(proc.time()-p)
## user system elapsed
## 385.044 0.932 386.126
n_it = 1
a = vector("list", n_it)
# diversity dependence model. parameters are par=c(lambda,mu,K)
time=proc.time()
for (i in 1:(n_it)){
s = sim_phyl()
a[[i]] = s$wt
}
t2 = proc.time()-time
paste(t2[3]/60,'min')
## [1] "0.00348333333333333 min"
n_it = 10
a = vector("list", n_it)
# diversity dependence model. parameters are par=c(lambda,mu,K)
time=proc.time()
for (i in 1:(n_it)){
s = sim_phyl()
a[[i]] = s$wt
}
t2 = proc.time()-time
paste(t2[3]/60,'min')
## [1] "0.03335 min"
n_it = 100
a = vector("list", n_it)
# diversity dependence model. parameters are par=c(lambda,mu,K)
time=proc.time()
for (i in 1:(n_it)){
s = sim_phyl()
a[[i]] = s$wt
}
t2 = proc.time()-time
paste(t2[3]/60,'min')
## [1] "0.315333333333333 min"