This function runs the forward-filtering backwards-sampling MCMC algorithm for a hidden Markov model with a Binomial and Normal response variable. The response variables are assumed conditionally independent given the states.
The following conjugate prior distributions are used:
For the initial state probabilities, a Dirichlet prior with parameter vector init_alpha
For each row in the transition probability matrix, a Dirichlet prior is used. The parameters of these Dirichlet distributions are contained in the matrix trans_alpha
.
For the probability of correct in the Binomial response, a Beta prior is used, with parameters bin_alpha
and bin_beta
.
For the mean and variance of the Normal response, a Normal-inverse-Gamma prior is used.
This function was written mainly for didactive purposes, not for speed (or compatibility with other packages which provide posterior samples).