plot.Markov: Plot the transition graph

View source: R/estimation.R

plot.MarkovR Documentation

Plot the transition graph

Description

Plot the transition graph between the different states. A node corresponds to a state with the mean time spent in this state. Each arrow represents the probability of transition between states.

Usage

## S3 method for class 'Markov'
plot(x, ...)

Arguments

x

output of estimate_Markov function

...

parameters of plotmat function from diagram package (see details).

Details

Some useful extra parameters:

  • main main title.

  • dtext controls the position of arrow text relative to arrowhead (default = 0.3).

  • relsize scaling factor for size of the graph (default = 1).

  • box.size size of label box, one value or a vector with dimension = number of rows of x$P.

  • box.cex relative size of text in boxes, one value or a vector with dimension=number of rows of x$P.

  • arr.pos relative position of arrowhead on arrow segment/curve.

Value

No return value, called for side effects

Author(s)

Cristian Preda

Examples

# Simulate the Jukes-Cantor model of nucleotide replacement
K <- 4
PJK <- matrix(1 / 3, nrow = K, ncol = K) - diag(rep(1 / 3, K))
lambda_PJK <- c(1, 1, 1, 1)
d_JK <- generate_Markov(n = 100, K = K, P = PJK, lambda = lambda_PJK, Tmax = 10)

# estimation
mark <- estimate_Markov(d_JK)

# transition graph
plot(mark)

modal-inria/cfda documentation built on Oct. 19, 2023, 10:03 a.m.