hmm(y, yval=NULL, par0=NULL, K=NULL, rand.start=NULL, stationary=TRUE,
mixture=FALSE, tolerance=1e-4, verbose=FALSE, itmax=200,
crit='PCLL',keep.y=TRUE, data.name=NULL)y is a matrix, each column is interpreted as an independent
replicate of the observation sequence.y. If any value of y does not match
some value of yval, it will be treated as a MISSING VALUE.tpm (transition probability
matrix) and Rho. The matrix Rho specifies the
probability that the observations take par0 is
not specified K MUST be; if par0 is specified, K
is ignored.Note that K=1 is acceptable; if K is 1 then all
observa
tpm and Rho, if tpm is TRUE then the function
init.all() chooses entries for then starting value of tpm at
random; likewise for RhoTRUE then the model is fitted under
the stationarity assumption, i.e. that the Markov chain was in
steady state at the time that observations commenced. In this
case the initial state probability distribution is itmax
EM steps have been performed, a warning message is printed out,
and the function stops. A value is returned by the function
anyway, with the logical component "converged" set toy
be returned as a component of the value of this function?y as determined by deparse(substitute(y)).Rho specifying the
distributions of the observations.tpm.tpm.y). Present
only if keep.y is TRUE.stationaryK=1 then tpm, ispd, converged, and
nstep are all set equal to NA in the list returned
by this function.Zucchini, W. and Guttorp, P., "A hidden Markov model for space-time precipitation," Water Resources Research vol. 27, pp. 1917-1923, 1991.
MacDonald, I. L., and Zucchini, W., "Hidden Markov and Other Models for Discrete-valued Time Series, Chapman & Hall, London, 1997.
Liu, Limin, "Hidden Markov Models for Precipitation in a Region of Atlantic Canada", Master's Report, University of New Brunswick, 1997.
sim.hmm(), mps(),
viterbi()# See the help for sim.hmm() for how to generate y.num.
fit.num <- hmm(y.num,K=2,verb=TRUE)
fit.num.mix <- hmm(y.num,K=2,verb=TRUE,mixture=TRUE)Run the code above in your browser using DataLab