| Title: | Coupled Hidden Markov Models |
|---|---|
| Description: | An exact and a variational inference for coupled Hidden Markov Models applied to the joint detection of copy number variations. |
| Authors: | Xiaoqiang Wang [aut], Julie Aubert [aut, cre] |
| Maintainer: | Julie Aubert <[email protected]> |
| License: | GPL-2 |
| Version: | 0.1.1 |
| Built: | 2026-05-23 06:38:43 UTC |
| Source: | https://github.com/julieaubert/chmm |
Perform exact inference of coupled hidden markov models.
CHMM_EM(X, nb.states, S, omega, meth.init = "mclust", var.equal = TRUE, itmax = 500, threshold = 1e-07)CHMM_EM(X, nb.states, S, omega, meth.init = "mclust", var.equal = TRUE, itmax = 500, threshold = 1e-07)
X |
a data matrix of observations. Columns correspond to individuals. |
nb.states |
a integer specifying the numbers of states. |
S |
a matrix of similarity between individuals. |
omega |
a value of omega. |
meth.init |
a string specifying the initialization method ("mclust" or "kmeans"). The default method is "mclust". |
var.equal |
a logical variable indicating whether to treat the variances as being equal. |
itmax |
an integer specifying the maximal number of iterations for the EM algorithm. |
threshold |
a value for the threshold used for the stopping criteria. |
a list of 10 components
postPra list containing for each series the posterior probabilities.
initGba numeric specifying the initial state probabilities.
transGba matrix of the state transition probabilities.
emisGba list containing for each series the emission probabilities.
esAvga numeric of the estimated mean for each state.
esVara numeric of the estimated variance for each state.
ID.Ka matrix containing all combination of possible state for nbI series.
loglika numeric with the value of the loglikelihood.
RSSa numeric corresponding to the Residuals Sum of Squares.
iterstopan integer corresponding to the total number of iterations.
Wang, X., Lebarbier, E., Aubert, J. and Robin, S., Variational inference for coupled Hidden Markov Models applied to the joint detection of copy number variations.
Perform variational inference of coupled Hidden Markov Models.
CHMM_VEM(X, nb.states, S = NULL, omega = 0.7, meth.init = "mclust", var.equal = TRUE, itmax = 500, threshold = 1e-07)CHMM_VEM(X, nb.states, S = NULL, omega = 0.7, meth.init = "mclust", var.equal = TRUE, itmax = 500, threshold = 1e-07)
X |
a data matrix of observations. Columns correspond to individuals. |
nb.states |
a integer specifying the numbers of states. |
S |
a matrix of similarity between individuals. |
omega |
a value of omega. |
meth.init |
a string specifying the initialization method ("mclust" or "kmeans"). The default method is "mclust". |
var.equal |
a logical variable indicating whether to treat the variances as being equal. |
itmax |
an integer specifying the maximal number of iterations for the EM algorithm. |
threshold |
a value for the threshold used for the stopping criteria. |
a list of 9 components
postPra list containing for each series the posterior probabilities.
initPra numeric specifying the initial state probabilities.
transPra matrix of the state transition probabilities.
esAvga numeric of the estimated mean for each state.
esVara numeric of the estimated variance for each state.
emisPra list containing for each series the emission probabilities.
emisPrWa list containing for each series the emission probabilities taking into account for the dependency structure.
RSSa numeric corresponding to the Residuals Sum of Squares.
iterstopan integer corresponding to the total number of iterations.
Wang, X., Lebarbier, E., Aubert, J. and Robin, S., Variational inference for coupled Hidden Markov Models applied to the joint detection of copy number variations.
Summarize the results of the coupled HMM.
clusterseg(x)clusterseg(x)
x |
a matrix of status. Columns corresponds to series (individuals). |
a data.frame with 4 columns
samplename of the sample (series).
posbeginbeginning position.
posendending position.
statusstatus.
Perform inference of coupled hidden markov models.
coupledHMM(X, nb.states = 3, S = NULL, omega.list = c(0.3, 0.7, 0.9), var.equal = TRUE, exact = FALSE, meth.init = "mclust", viterbi = TRUE, itmax = 500, threshold = 1e-07)coupledHMM(X, nb.states = 3, S = NULL, omega.list = c(0.3, 0.7, 0.9), var.equal = TRUE, exact = FALSE, meth.init = "mclust", viterbi = TRUE, itmax = 500, threshold = 1e-07)
X |
a matrix of observations. Columns correspond to series (individuals). |
nb.states |
a integer specifying the numbers of states. |
S |
a matrix of similarity between individuals. |
omega.list |
a vector of omega values. |
var.equal |
a logical variable indicating whether to treat the variances as being equal (var.equal = TRUE). |
exact |
a logical variable indicating whether to use VEM (exact = FALSE) or EM (exact = TRUE) algorithm for the inference of the model. |
meth.init |
a string specifying the initialization method ("mclust" or "kmeans") for the (V)-EM algorithm. The default method is "mclust". |
viterbi |
a logical variable indicating whether to use Maximum A Posteriori method (FALSE) or Viterbi algorithm (TRUE, by default) for recovering the most likely path. |
itmax |
an integer specifying the maximal number of iterations for the CHMM_(V)EM algorithm. |
threshold |
a value for the threshold used for the stopping criteria for the CHMM_(V)EM algorithm. |
A list of 4 objets.
omegaan integer corresponding to the selected value among the omega.list.
modela list corresponding to the output of the CHMM-EM or CHMM-VEM function for the selected model.
statusa matrix with status associated to each series in column and each position in row.
RSS.omegaa dataframe with omega values and the associated Residuals Sum of Squares.
Wang, X., Lebarbier, E., Aubert, J. and Robin, S., Variational inference for coupled Hidden Markov Models applied to the joint detection of copy number variations.
data(toyexample) # Variational inference of a coupled hidden Markov Chains resCHMM <- coupledHMM(X = toydata, nb.states = 3, S = cor(toystatus), omega.list = c(0.3, 0.5, 0.7, 0.9)) # Breakpoints positions and status of segments info <- clusterseg(resCHMM$status) # head(info)data(toyexample) # Variational inference of a coupled hidden Markov Chains resCHMM <- coupledHMM(X = toydata, nb.states = 3, S = cor(toystatus), omega.list = c(0.3, 0.5, 0.7, 0.9)) # Breakpoints positions and status of segments info <- clusterseg(resCHMM$status) # head(info)
CHMM_EM function.Initialization step of the CHMM_EM function.
init.EM(X, nb.states, meth.init, var.equal, nbI, nbT)init.EM(X, nb.states, meth.init, var.equal, nbI, nbT)
X |
a matrix of observations. Columns correspond to series (individuals). |
nb.states |
an integer specifying the numbers of states. |
meth.init |
a string specifying the initialization method ("mclust" or "kmeans"). The default method is "mclust". |
var.equal |
a logical variable indicating whether to treat the variances as being equal (TRUE, value by default) or not (FALSE). |
nbI |
an integer specifying the number of series. |
nbT |
an integer specifying the length of one series. |
By default, an initialization with the meth.init="mclust" is performed with homogeneous variances.
A list of 6 objects.
esAvgGb a matrix of nbK(nb.states^nbI) rows and nbI columns of estimated mean.
esVarGb a matrix of nbK(nb.states^nbI) rows and nbI columns of estimated variance.
esAvga numeric of the estimated mean for each state.
esVara numeric of the estimated variance for each state.
transGba matrix of the state transition probabilities.
initGba numeric specifying the initial state probabilities.
CHMM_VEM function.Initialization step of the CHMM_VEM function.
init.VEM(X, nb.states, meth.init, var.equal, nbI, nbT)init.VEM(X, nb.states, meth.init, var.equal, nbI, nbT)
X |
a matrix of observations. Columns correspond to series (individuals). |
nb.states |
an integer specifying the numbers of states. |
meth.init |
a string specifying the initialization method ("mclust" or "kmeans"). The default method is "mclust". |
var.equal |
a logical variable indicating whether to treat the variances as being equal (TRUE, value by default) or not (FALSE). |
nbI |
an integer specifying the number of series. |
nbT |
an integer specifying the length of one series. |
A list containing the parameters of the model
esAvga numeric of the estimated mean for each state.
esVara numeric of the estimated variance for each state.
transPra matrix of the state transition probabilities
postPra list containing for each series the posterior probabilities.
initPra numeric specifying the initial state probabilities
.
A matrix containing the observations for the 1,000 positions of 5 correlated samples.
A simulated matrix with 1000 rows and 5 columns. Each column is a series
data(toyexample) # Variational inference of a coupled hidden Markov Chains resCHMM <- coupledHMM(X = toydata, nb.states = 3, S = cor(toystatus), omega.list = c(0.3, 0.5, 0.7, 0.9)) # Breakpoints positions and status of segments info <- clusterseg(resCHMM$status) # head(info)data(toyexample) # Variational inference of a coupled hidden Markov Chains resCHMM <- coupledHMM(X = toydata, nb.states = 3, S = cor(toystatus), omega.list = c(0.3, 0.5, 0.7, 0.9)) # Breakpoints positions and status of segments info <- clusterseg(resCHMM$status) # head(info)
A matrix containing the hidden status for the 1,000 positions of 5 correlated samples.
A matrix of the hidden status corresponding to the toydata matrix.