ms_validate_Q: Validate a generator matrix

View source: R/structures.R

ms_validate_QR Documentation

Validate a generator matrix

Description

Checks that a user-supplied generator is square, numeric, finite and has non-negative off-diagonal elements, repairs the diagonal, and reports states that cannot be reached from state one.

Usage

ms_validate_Q(Q, strict = FALSE)

Arguments

Q

A square numeric matrix of transition intensities.

strict

Logical. If TRUE, unreachable states raise an error rather than a warning.

Value

The validated generator, invisibly, with the diagonal set to minus the row sum of the off-diagonal elements.

Examples

ms_validate_Q(rbind(c(0, 0.2, 0.1), c(0, 0, 0.4), c(0, 0, 0)))

modMStates documentation built on Sept. 3, 2026, 5:10 p.m.