| dmm | R Documentation |
Creates a drifting Markov model object dmm from parameters given by the user.
dmm(states, init, matrices, order, degree = length(matrices) - 1, length)
states |
Vector of states space of length s > 1 |
init |
Initial law of the |
matrices |
A list of |
order |
Order of the Markov chain |
degree |
Default= |
length |
Length |
This function creates a drifting Markov model object dmm without estimation,
starting from the points of support transition matrices and the initial law specified by the user.
The resulting object has the same structure as the one returned by fitdmm, so that
it can be used with all the functions of the package (e.g., simulate.dmm,
getTransitionMatrix, reliability, etc.).
A polynomial drifting Markov chain of order k, degree d and length n
is defined by d+1 Markov transition matrices (of order k)
\Pi_{\frac{i}{d}}, i = 0, \ldots, d, called points of support. The transition matrix
at position t, t = 1, \ldots, n, is
\Pi_{\frac{t}{n}} = \sum_{i=0}^d A_i(t) \Pi_{\frac{i}{d}}, where A_i are the Lagrange
polynomials of degree d such that A_i(\frac{nj}{d}) = 1_{\{i=j\}}.
For a linear drifting Markov chain (d = 1), we have
\Pi_{\frac{t}{n}} = ( 1 - \frac{t}{n}) \Pi_0 + \frac{t}{n} \Pi_1.
Each matrix of 'matrices' has s^k rows (one for each word of length k) and
s columns (one for each state). If the matrices have no row names, the rows are taken in
the alphabetical order of the words of length k (as in fitdmm); otherwise the
rows are reordered according to their names. The columns are in the order of 'states' (or
reordered according to their names). In the returned object, the states are sorted in alphabetical
order, as in fitdmm.
An object of class dmm
Georges Sadaka
BaVe2018drimmR \insertRefVer08drimmR
fitdmm, simulate.dmm, getTransitionMatrix
states <- c("a", "c", "g", "t")
# Points of support transition matrices
Pi0 <- matrix(c(0.25, 0.25, 0.25, 0.25,
0.10, 0.40, 0.40, 0.10,
0.30, 0.20, 0.20, 0.30,
0.40, 0.10, 0.10, 0.40),
nrow = 4, byrow = TRUE)
Pi1 <- matrix(c(0.70, 0.10, 0.10, 0.10,
0.10, 0.70, 0.10, 0.10,
0.10, 0.10, 0.70, 0.10,
0.10, 0.10, 0.10, 0.70),
nrow = 4, byrow = TRUE)
model <- dmm(states = states, init = c(0.25, 0.25, 0.25, 0.25),
matrices = list(Pi0, Pi1), order = 1, degree = 1, length = 1000)
getTransitionMatrix(model, pos = 500)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.