R/Var.e.r

Defines functions Var.e

Documented in Var.e

#' @export
Var.e=function(y,S){
  df=fdata.trace(S)
  if (is.vector(y)) {
	  n=length(y)
	  y.est=S%*%y
	  se=sum((y-y.est)^2,na.rm=TRUE)/(n-df)
	  var.e=se*diag(ncol(S))
  }
  else {
    if (!is.fdata(y)) y<-fdata(y)
    y<-y[["data"]]
	  n=ncol(S)
	  y.est<-t(S%*%t(y))
	  var.e<-t(y-y.est)%*%(y-y.est)/(n-df)
  	}
  return(var.e)
}

Try the fda.usc package in your browser

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

fda.usc documentation built on Oct. 17, 2022, 9:06 a.m.