predict.fregre.gls

Predictions from a functional gls object

The predictions for the functional generalized least squares fitted linear model represented by object are obtained at the covariate values defined in newx.

Keywords
models, regresion
Usage
# S3 method for fregre.gls
predict(
  object,
  newx = NULL,
  type = "response",
  se.fit = FALSE,
  scale = NULL,
  df,
  interval = "none",
  ...
)

# S3 method for fregre.igls predict( object, newx = NULL, data, df = df, weights = 1, pred.var, n.ahead = 1L, ... )

Arguments
object

fregre.gls object.

newx

An optional data list in which to look for variables with which to predict. If omitted, the fitted values are used. List of new explanatory data.

type

Type of prediction (response or model term).

se.fit

=TRUE (not default) standard error estimates are returned for each prediction.

scale

Scale parameter for std.err. calculation.

df

Degrees of freedom for scale.

interval

Type of interval calculation.

Further arguments passed to or from other methods.

data

Data frame with the time or spatinal index

weights

variance weights for prediction. This can be a numeric vector or a one-sided model formula. In the latter case, it is interpreted as an expression evaluated in newdata

pred.var

the variance(s) for future observations to be assumed for prediction intervals. See link{predict.lm} for more details.

n.ahead

number of steps ahead at which to predict.

Value

a vector with the predicted values.

References

Oviedo de la Fuente, M., Febrero-Bande, M., Pilar Munoz, and Dominguez, A. Predicting seasonal influenza transmission using Functional Regression Models with Temporal Dependence. arXiv:1610.08718. https://arxiv.org/abs/1610.08718

See Also

fregre.gls

Aliases
  • predict.fregre.gls
  • predict.fregre.igls
Examples
# NOT RUN {
data(tecator)
ind<-1:190
x <-fdata.deriv(tecator$absorp.fdata,nderiv=1)
dataf=as.data.frame(tecator$y)
dataf$itime <- 1:nrow(x)
ldat=list("df"=dataf[ind,],"x"=x[ind])
newldat=list("df"=dataf[-ind,],"x"=x[-ind])
newy <- tecator$y$Fat[-ind]
ff <- Fat ~ x
res.lm <- fregre.lm(ff,data=ldat)
summary(res.lm)
res.gls <- fregre.gls(ff,data=ldat, correlation=corAR1())
summary(res.gls)
par.cor <- list("cor.ARMA"=list("p"=1))
par.cor <- list("cor.ARMA"=list("index"=c("itime"),"p"=1))
res.igls <- fregre.igls(ff,data=ldat,correlation=par.cor) 
pred.lm <- predict(res.lm,newldat)
pred.gls <- predict(res.gls,newldat)
pred.igls <- predict(res.igls,newldat)
mean((pred.lm-newldat$df$Fat)^2)
mean((pred.gls-newldat$df$Fat)^2)
mean((pred.igls-newldat$df$Fat)^2)
# }
# NOT RUN {
# }
Documentation reproduced from package fda.usc, version 2.0.1, License: GPL-2

Community examples

Looks like there are no examples yet.