View source: R/f_phyclust_em_step.r
| phyclust.e.step | R Documentation |
This is a single E-step of phyclust, usually following or followed
by the other M-step.
phyclust.e.step(X, ret.phyclust = NULL, K = NULL, Eta = NULL,
Mu = NULL, pi = NULL, kappa = NULL, Tt = NULL,
substitution.model = NULL, identifier = NULL, code.type = NULL,
Z.state = TRUE, label = NULL)
X |
nid/sid matrix with |
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, |
substitution.model |
substitution model. |
identifier |
identifier. |
code.type |
code type. |
Z.state |
see ‘Details’. |
label |
label of sequences for semi-supervised clustering. |
X should be a numerical matrix containing sequence data that
can be transfered by code2nid or code2sid.
Either input ret.phyclust or all other arguments for this function
except Z.state. ret.phyclust can be obtain either from an
EM iteration of phyclust or from a M step of phyclust.m.step.
Z.state indicates the return values of Z_{nk}. If
TRUE, the Z.normalized returned by this function will be
posterior probabilities. Otherwise, it will be logPt, log of
transition probabilities, \log(\phi(\cdots)).
If label is inputted, the label information will be used
the E-step, even the ret.phyclust is the result of unsupervised
clustering.
This function returns a Z_{nk} matrix with dimension =
N\times K. The values is dependent on Z.state, and
they are either posterior probabilities if TRUE or transition
probabilities otherwise.
Wei-Chen Chen wccsnow@gmail.com
Phylogenetic Clustering Website: https://snoweye.github.io/phyclust/
phyclust,
phyclust.em.step,
phyclust.m.step.
## Not run:
library(phyclust, quiet = TRUE)
set.seed(1234)
EMC.1 <- .EMC
EMC.1$EM.iter <- 1
# the same as EMC.1 <- .EMControl(EM.iter = 1)
X <- seq.data.toy$org
ret.1 <- phyclust(X, 2, EMC = EMC.1)
ret.2 <- phyclust.e.step(X, ret.phyclust = ret.1)
str(ret.2)
# For semi-supervised clustering.
semi.label <- rep(0, nrow(X))
semi.label[1:3] <- 1
ret.3 <- phyclust.e.step(X, ret.phyclust = ret.1, label = semi.label)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.