most_probable_cluster: Extract Most Probable Cluster for Each Sequence

View source: R/most_probable_cluster.R

most_probable_clusterR Documentation

Extract Most Probable Cluster for Each Sequence

Description

Extract Most Probable Cluster for Each Sequence

Usage

most_probable_cluster(x, type = "viterbi", hp = NULL)

Arguments

x

An object of class mhmm or mnhmm.

type

A character string specifying the method to use. Either "viterbi" (default) or "posterior". Former uses the most probable hidden path to determine the cluster membership for each sequence, while the latter finds the cluster which has the largest sum of posterior probabilities of states of that cluster.

hp

An output from hidden_paths() function. Only used in case of type = "viterbi". If missing, hidden paths will be computed using x.

Value

A vector containing the most probable cluster for each sequence.


seqHMM documentation built on June 8, 2025, 10:16 a.m.