Skip to content

compute_event_transition_matrix() ​

compute_event_transition_matrix() summarizes how often one event is immediately followed by another in event order.

Function Usage ​

python
compute_event_transition_matrix(
    eseq,
    weighted=True,
    normalize=True,
    use_weights=None
)

TraMineR Parameter Mapping ​

  • event_sequences -> TraMineR eseq object
  • weighted -> TraMineR::seqetm() weighted

Entry Parameters ​

ParameterRequiredTypeDescription
event_sequences (event_sequences)✓EventSequenceData / EventSequenceListThe full event-sequence dataset to summarize.
weighted✗boolUse sequence weights if available.
normalize✗boolIf True, convert counts to row-wise probabilities.
use_weights✗bool / NoneBackward-compatible alias for weighted. If provided, it overrides weighted.

Returns ​

A square DataFrame where:

  • Rows = source event
  • Columns = next event in order
  • Values = adjacent event-order count or row-wise probability

Example ​

python
tm = compute_event_transition_matrix(eseq, normalize=True)
print(tm)

R Counterpart ​

  • Closest R function: TraMineR::seqetm()
  • Mapping note: This is a practical Sequenzo helper for summarizing adjacent event-to-event movements. It is related to transition-focused event-sequence workflows, but it should not be confused with the formal event-sequence definition of a transition, where a transition may contain several simultaneous events.

Notes ​

  • When normalize=True, each non-empty row sums to 1.
  • Use normalize=False to get raw weighted counts.

See Also ​

Authors ​

Code: Yuqi Liang

Documentation: Yuqi Liang

References ​

Ritschard, G., Bürgin, R., & Studer, M. (2013). Exploratory Mining of Life Event Histories. In J. J. McArdle & G. Ritschard (Eds.), Contemporary Issues in Exploratory Data Mining in the Behavioral Sciences (pp. 221-253). Routledge.

Sequenzo is released under the BSD-3-Clause License; this documentation site source is licensed under MIT.