Learn R Programming

evreg (version 1.1.1)

intervals: Computation of prediction intervals from a trained ENNreg model

Description

intervals computes probabilistic and belief prediction intervals from a prediction object returned by function predict.ENNreg.

Usage

intervals(pred, level = 0.9, yt = NULL)

Value

A list with four elements:

INTP

Matrix (n,2) of probabilistic prediction intervals.

INTBel

Matrix (n,2) of belief prediction intervals.

coverage.P

Estimated coverage rate of the probabilistic intervals (if yt is provided).

coverage.Bel

Estimated coverage rate of the belief intervals (if yt is provided).

Pl.Bel

Mean plausibility of the belief intervals.

Arguments

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.

See Also

predict.ENNreg, ENNreg

Examples

Run this code
library(MASS)
# \donttest{
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))
# }

Run the code above in your browser using DataLab