reorder.hglmm {hglmm} | R Documentation |
Reorder the states of a fitted hglmm model so that the state effects are in decreasing order.
## S3 method for class 'hglmm' reorder(x, ...)
x |
An object of class |
... |
Not used. |
The states of a fitted hidden Markov model are usually in a rather arbitrary order, which can sometimes make it difficult to compare different fits. This function reorders the states so that the state corresponding to the largest state effect comes first (and so on down the line).
An object of class "hglmm"
which is identical to
the argument x
in most respects. The components
which differ are:
params
(the components of this component will,
or at least may, differ from those of the original)
theta
hessian
grad
lam
fy
The entries of these components (or sub-components) will have the same numerical values but will have somewhat different ordering, corresponding to the different ordering of the states.
Rolf Turner r.turner@auckland.ac.nz
hglmm()
loc4 <- c("LngRf","BondiE","BondiOff","MlbrOff") SCC4 <- SydColCount[SydColCount$locn %in% loc4,] SCC4$locn <- factor(SCC4$locn) # Get rid of unused levels. rownames(SCC4) <- 1:nrow(SCC4) fit <- hglmm(y~locn+depth,SCC4,c("locn","depth"),K=2, verb=TRUE) ofit <- reorder(fit)