fitted.hglmm {hglmm}R Documentation

Predict method for hidden generalized linear Markov models.

Description

Predicted values based on hidden generalized linear Markov model object.

Usage

## S3 method for class 'hglmm'
fitted(object, ...)

Arguments

object

An object of class hglmm as returned by hglmm().

...

Not used.

Details

Although this documentation refers to “generalized linear models”, currently only log linear Poisson models are provided for. More flexibility may be added at a future date.

Value

A vector of fitted values of the same length as that of the observed values (i.e. length equal to the row dimension of the data frame to which the model was fitted. This data frame is equal to object$data but with repeated rows corresponding to different states collapsed to a single row. The row dimension of this data frame is thus nrow(object$data)/K where K is the number of states in the model. This data frame, with columns cf and state omitted, is returned as an attribute data of the vector of fitted values.

Author(s)

Rolf Turner r.turner@auckland.ac.nz

References

See the help for hglmm() for references.

See Also

rhglmm() rhglmm.default() rhglmm.hglmm() bcov()

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,data=SCC4,cells=c("locn","depth"),
                     K=2,contr="sum",verb=TRUE)
    fv  <- fitted(fit)
    with(attr(fv,"data"),plot(y[locn=="BondiOff" & depth=="40"],
             xlab="time",ylab="count"))
    with(attr(fv,"data"),lines(fv[locn=="BondiOff" & depth=="40"]))

[Package hglmm version 0.0-14 Index]