View source: R/fitted.eglhmm.R
fitted.eglhmm | R Documentation |
Predicted values based on an extended generalised linear hidden Markov model object.
## S3 method for class 'eglhmm'
fitted(object, ...)
object |
An object of class |
... |
Not used. |
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.
Although this documentation refers to “generalised linear models”, the only such models currently (\today) available are the Gaussian model with the identity link, the Poisson model, with the log link, and the Binomial model with the logit link. Other models may be added at a future date.
Rolf Turner rolfturner@posteo.net
See the help for eglhmm()
for references.
reglhmm()
reglhmm.default()
reglhmm.eglhmm()
bcov()
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 <- eglhmm(y~locn+depth,data=SCC4,cells=c("locn","depth"),
K=2,distr="P",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"]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.