View source: R/f_phyclust_se_update.r
| phyclust.se.update | R Documentation |
Since phyclust.se is difficult to optimize on a constrained high
dimension parameter space, the phyclust is relatively easier to
find a better result, as well as the find.best function.
This function will use the phyclust result as initial parameters and
perform a sequencing error model. All parameters (Eta, Mu, Q, ...) in this
function will be updated through the EM algorithm as phyclust.se.
Typically, this function run on the find.best results will yield
a better result than on the phyclust.se.
phyclust.se.update(X, EMC = .EMC, ret.phyclust = NULL,
K = NULL, Eta = NULL, Mu = NULL, pi = NULL, kappa = NULL,
Tt = NULL, byrow = TRUE)
X |
nid/sid matrix with |
EMC |
EM control. |
ret.phyclust |
an object with the class |
K |
number of clusters. |
Eta |
proportion of subpopulations, |
Mu |
centers of subpopulations, dim = |
pi |
equilibrium probabilities, each row sums to 1. |
kappa |
transition and transversion bias. |
Tt |
total evolution time, |
byrow |
advanced option for |
All the input arguments are the same as the inputs of the function
phyclust.em.step and phyclust.update.
This function returns an object with class phyclust.
Wei-Chen Chen wccsnow@gmail.com
Phylogenetic Clustering Website: https://snoweye.github.io/phyclust/
phyclust.se,
phyclust.update,
phyclust,
find.best.
## Not run:
library(phyclust, quiet = TRUE)
set.seed(1234)
X <- seq.data.toy$org
(ret.1 <- find.best(X, 4))
(ret.2 <- phyclust.se.update(X, ret.phyclust = ret.1))
.EMC$se.constant <- 1e-3
(ret.3 <- phyclust.se.update(X, ret.phyclust = ret.2))
### Search optimal error
func <- function(C){
.EMC$se.constant <<- C
-phyclust.se.update(X, ret.phyclust = ret.1)$logL
}
(ret.opt <- optimize(f = func, lower = 1e-3, upper = 1e-1))
.EMC$se.constant <- ret.opt$minimum
(ret.se.opt <- phyclust.se.update(X, ret.phyclust = ret.1))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.