Computation of prediction intervals from a trained ENNreg model
intervals
computes probabilistic and belief prediction intervals from a prediction object returned by function predict.ENNreg
.
intervals(pred, level = 0.9, yt = NULL)
pred
: Prediction object returned by function predict.ENNreg
.level
: Level of the prediction interval (between 0 and 1).yt
: Optional vector of test response values.A list with four elements:
library(MASS) X<-as.matrix(scale(Boston[,1:13])) y<-Boston[,14] set.seed(220322) n<-nrow(Boston) ntrain<-round(0.7*n) train <-sample(n,ntrain) fit <- ENNreg(X[train,],y[train],K=30) pred<-predict(fit,newdata=X[-train,],yt=y[-train]) int<- intervals(pred,level=0.95,y[-train]) print(c(int$coverage.P,int$coverage.Bel))
predict.ENNreg
, ENNreg
Useful links