cnvrtRho | R Documentation |
Converts a matrix specification of the emission probabilities (in which the probabilities are simply the entries of the matrix) to a data frame specification (in which the probabilities are a logistic-style function of the parameters) or vice versa.
cnvrtRho(Rho)
Rho |
A specification of the emission probabilities of a
discrete valued hidden Markov model. It may be either a
matrix of these probabilities, in which case it is converted
to a three column data frame, or it may be a three column
data frame, in which case it is converted to a matrix
of probabilities. See |
The data frame specification of Rho
allows
for predictor variables x
. If Rho
is of the
data frame form, and is designed to allow for predictor
variables, then it will have more than three columns and
cannot be converted to the matrix form. In such
cases cnvrtRho
will throw an error.
A data frame if the argument Rho
is a matrix,
or a matrix if the argument Rho
is a data
frame.
Rolf Turner
r.turner@auckland.ac.nz
hmm()
Yval <- LETTERS[1:10] Tpm <- matrix(c(0.75,0.25,0.25,0.75),ncol=2,byrow=TRUE) Rho <- cbind(c(rep(1,5),rep(0,5)),c(rep(0,5),rep(1,5)))/5 rownames(Rho) <- Yval newRho <- cnvrtRho(Rho) oldRho <- cnvrtRho(newRho)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.