mc_to_sc {seqHMM} | R Documentation |
Transform a Multichannel Hidden Markov Model into a Single Channel Representation
Description
Transforms data and parameters of a multichannel model into a single channel model. Observed states (symbols) are combined and parameters multiplied across channels.
Usage
mc_to_sc(model, combine_missing = TRUE, all_combinations = FALSE, cpal)
Arguments
model |
An object of class |
combine_missing |
Controls whether combined states of observations
at time |
all_combinations |
Controls whether all possible combinations of
observed states are included in the single channel representation or only
combinations that are found in the data. Defaults to |
cpal |
The color palette used for the new combined symbols. Optional in
a case where the number of symbols is less or equal to 200 (in which case
the |
Details
Note that in case of no missing observations, the log-likelihood of
the original and transformed models are identical but the AIC and BIC
can be different as the model attribute df
is recomputed based
on the single channel representation.
See Also
build_hmm
and fit_model
for building and
fitting Hidden Markov models; and hmm_biofam
for information on
the model used in the example.
Examples
# Loading a hidden Markov model of the biofam data (hmm object)
data("hmm_biofam")
# Convert the multichannel model to a single-channel model
sc <- mc_to_sc(hmm_biofam)
# Likelihoods of the single-channel and the multichannel model are the same
# (Might not be true if there are missing observations)
logLik(sc)
logLik(hmm_biofam)