mm {smmR}R Documentation

Markov model specification

Description

Creates a model specification of a Markov model.

Usage

mm(states, init, ptrans, k = 1)

Arguments

states

Vector of state space of length s.

init

Vector of initial distribution of length s ^ k.

ptrans

Matrix of transition probabilities of dimension (s, s).

k

Order of the Markov chain.

Value

An object of class mm.

See Also

simulate.mm, fitmm

Examples

states <- c("a", "c", "g", "t")
s <- length(states)
k <- 1
init <- rep.int(1 / s, s)
p <- matrix(c(0, 0, 0.3, 0.4, 0, 0, 0.5, 0.2, 0.7, 0.5, 
              0, 0.4, 0.3, 0.5, 0.2, 0), ncol = s)

# Specify a Markov model of order 1
markov <- mm(states = states, init = init, ptrans = p, k = k)


[Package smmR version 1.0.3 Index]