reorder.hglmm {hglmm}R Documentation

Reorder the states of a fitted hglmm model

Description

Reorder the states of a fitted hglmm model so that the state effects are in decreasing order.

Usage

## S3 method for class 'hglmm'
reorder(x, ...)

Arguments

x

An object of class "hglmm" as returned by the function hglmm().

...

Not used.

Details

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).

Value

An object of class "hglmm" which is identical to the argument x in most respects. The components which differ are:

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.

Author(s)

Rolf Turner r.turner@auckland.ac.nz

See Also

hglmm()

Examples

    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)

[Package hglmm version 0.0-14 Index]