mm: Markov model specification

Description Usage Arguments Value See Also Examples

View source: R/mm.R

Description

Creates a model specification of a Markov model.

Usage

1
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

1
2
3
4
5
6
7
8
9
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)

smmR documentation built on Aug. 3, 2021, 5:07 p.m.