transition_table | R Documentation |
Finds the state sequence of a new sequence in an EMM and returns a table with the transition probabilities or counts.
## S4 method for signature 'EMM,matrix'
transition_table(x, newdata,
type = c("probability", "counts", "log_odds"),
match_cluster = "exact", prior=TRUE, initial_transition = FALSE)
x |
an |
newdata |
new sequence, |
type |
the measure to return. |
match_cluster |
do the new observations have to fall within
the threshold of the cluster ( |
prior |
add one to each transition count. This is equal to starting with a uniform prior for the transition count distribution, i.e. initially all transitions are equally likely. It also prevents the product of probabilities to be zero if a transition was never observed. |
initial_transition |
include the initial transition in the table? |
A data.frame with three columns (from state, to state and the transition probability/count.)
transition
to access transition probabilities
and find_clusters
for assigning observations to states/clusters.
data("EMMsim")
emm <- EMM(threshold=.5)
emm <- build(emm, EMMsim_train)
head(transition_table(emm, EMMsim_test))
head(transition_table(emm, EMMsim_test, type ="prob", initial_transition=TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.