Assign the hidden states at each time step t to the hidden state k with largest quantity of interest.
classify_quantity(fit, reduce, chain, quantity)
fit | An object returned by either |
---|---|
reduce | An optional function applied to the samples corresponding to one time step t, one hidden state k, and one chain m. The observation at time step t is then assigned to the hidden state with largest value. Note that the user needs to supply a function as an argument, and not a character string with the name of the function. This argument is not used for maximum a posteriori estimates returned by |
chain | Either "all" or any integer number between 1 and the number of chains M. In the latter case, only the samples generated by the selected chain are considered. This argument is not used for maximum a posteriori estimates returned by |
quantity | A character string with the name of the parameter to be classified (most likely a probability such as "alpha" or "gamma"). Note that no every estimated parameter has the structure needed for classification. |
A numeric vector with size equal to the time series length T with values from 1 to the number of hidden states K.