R/predict.fRegress.R

Defines functions residuals.fRegress predict.fRegress

Documented in predict.fRegress residuals.fRegress

predict.fRegress <- function(object, newdata=NULL, se.fit = FALSE,
     interval = c("none", "confidence", "prediction"),
     level = 0.95, ...){
##
## 1.  fit ???
##
  if(is.null(newdata))
    pred <- object$yhatfdobj
  else{
    nx <- length(object$xfdlist)
    Nnew <- length(newdata)
    pred <- rep(0, Nnew)
    for(i in 1:nx){
      xi <- predict(object$xfdlist[[i]], newdata)
      bi <- predict(object$betaestlist[[i]], newdata)
      pred <- pred+bi*xi
    }
  }
##
## 2.  Need se.fit?
##
  int <- match.arg(interval)
  need.se <- (se.fit || (int != "none"))
  if(!need.se)return(pred)
#
  stop('Need se.fit;  not implemented yet')
}

residuals.fRegress <- function(object, ...){
  object$yfdPar - predict(object, ...)
}

Try the fda package in your browser

Any scripts or data that you put into this service are public.

fda documentation built on May 2, 2019, 5:12 p.m.