Learn R Programming

rEMM (version 0.1-2)

transition_table: Extract a Transition Table for a New Sequence Given an EMM

Description

Finds the state sequence of a new sequence in an EMM and returns a table with the transition probabilities or counts.

Usage

## S3 method for class 'EMM,matrix':
transition_table(x, newdata, method = c("prob", "counts", "log_odds"), match_state = "nn", plus_one=TRUE, initial_transition = FALSE)

Arguments

x
an EMM object.
newdata
new sequence,
method
the measure to return.
match_state
do the new observations have to fall within the threshold of state ("exact") or is nearest neighbor used ("nn")?
plus_one
add one to each transition count. This is equal to start with one for each transition count, i.e. initially all transitions are equally likely. It prevents the product of probabilities to be zero if a transition was never observe
initial_transition
include the initial transition in the table?

Value

  • A data.frame with three columns (from state, to state and the transition probability/count.)

See Also

transition to access transition probabilities and find_states for assigning observations to states/clusters.

Examples

Run this code
data("EMMsim")

emm <- EMM(threshold=.5)
emm <- build(emm, EMMsim_train)

transition_table(emm, EMMsim_test)
transition_table(emm, EMMsim_test, method ="prob", initial_transition=TRUE)

Run the code above in your browser using DataLab