transitions {MCMCprecision} | R Documentation |
Get matrix of observed transition frequencies
Description
Summarizes a sequence of discrete values by the observed transition frequencies.
Usage
transitions(z, labels, order = 1)
Arguments
z |
vector of model indices (numerical or character) |
labels |
fixed labels for models that should be included in transition matrix, e.g., |
order |
order of the transition table. If |
Value
a square matrix with transition frequencies
Examples
P <- matrix(c(.9,.1,0,
.1,.6,.3,
.2,.3,.5), 3, byrow=TRUE)
z <- rmarkov(2000, P)
transitions(z)
transitions(z, order = 2)
[Package MCMCprecision version 0.4.0 Index]