plot.chain_structure: Plot method for 'chain_structure'

View source: R/chain_structure.R

plot.chain_structureR Documentation

Plot method for chain_structure

Description

Renders the hitting-probability matrix as a heatmap, with rows and columns ordered by communicating class so the block structure is visible at a glance. State labels along both axes are coloured by classification (absorbing / recurrent / transient). The subtitle summarises the chain-level properties (regular, reversible).

Usage

## S3 method for class 'chain_structure'
plot(x, show_values = TRUE, digits = 2L, ...)

Arguments

x

A chain_structure object.

show_values

Logical. If TRUE (default), prints the numeric probability inside each cell. Set FALSE for large state spaces (n > 10) where labels overlap.

digits

Integer. Decimal places for in-cell labels.

...

Ignored.

Details

Cell colour encodes ⁠P(ever reach j | start at i)⁠. The diagonal uses the return-time convention (⁠P(return to j in >= 1 steps)⁠), matching markovchain::hittingProbabilities. A non-irreducible chain shows zero off-block entries – visual evidence of one-way doors between behavioural phases. An absorbing chain shows a column of 1's for the absorbing state.

Value

A ggplot object.


Nestimate documentation built on July 11, 2026, 1:09 a.m.