hmhmm {bayess}  R Documentation 
This function implements a Metropolis within Gibbs algorithm that produces
a sample on the parameters p_{ij}
and q^i_j
of the hidden Markov
model (Chapter 7). It includes a function likej
that computes the likelihood of
the times series using a forwardbackward algorithm.
hmhmm(M = 100, y)
M 
Number of Gibbs iterations 
y 
times series to be modelled by a hidden Markov model 
The MetropoliswithinGibbs step involves Dirichlet proposals with a random choice of the scale between 1 and 1e5.
BigR 
matrix of the iterated values returned by the MCMC algorithm containing

olike 
sequence of the loglikelihoods produced by the MCMC sequence 
res=hmhmm(M=500,y=sample(1:4,10,rep=TRUE))
plot(res$olike,type="l",main="loglikelihood",xlab="iterations",ylab="")