Learn R Programming

MorphSim (version 0.1.0)

symmetric.Q.matrix: Generate a symmetric Q matrix

Description

Creates a K x K symmetric rate matrix (Q matrix) with equal transition rates between states. The diagonal elements are set such that each row sums to zero.

Usage

symmetric.Q.matrix(K)

Value

A K x K numeric matrix representing the symmetric Q matrix.

Arguments

K

Integer. The number of states.

Examples

Run this code
symmetric.Q.matrix(4)

Run the code above in your browser using DataLab