Constructs prediction intervals with the 16 methods (PIBF method implemented
in pibf() and 15 method variations implemented in rfpi()).
piall(
formula,
traindata,
testdata,
alpha = 0.05,
num.trees = 2000,
mtry = ceiling(px/3)
)A list with the following components:
Prediction intervals for test data with PIBF method. A list containing lower and upper bounds.
Prediction intervals for test data with least-squares (LS) splitting rule and classical method (LM). A list containing lower and upper bounds.
Prediction intervals for test data with least-squares (LS) splitting rule and shortest PI (SPI) method. A list containing lower and upper bounds.
Prediction intervals for test data with least-squares (LS) splitting rule and quantiles method. A list containing lower and upper bounds.
Prediction intervals for test data with least-squares (LS) splitting rule and highest density region (HDR) method. A list containing lower and upper bounds of prediction interval for each test observation. There may be multiple PIs for a single observation.
Prediction intervals for test data with least-squares (LS) splitting rule and contiguous HDR method. A list containing lower and upper bounds.
Prediction intervals for test data with \(L_1\) splitting rule and classical method (LM). A list containing lower and upper bounds.
Prediction intervals for test data with \(L_1\) splitting rule and shortest PI (SPI) method. A list containing lower and upper bounds.
Prediction intervals for test data with \(L_1\) splitting rule and quantiles method. A list containing lower and upper bounds.
Prediction intervals for test data with \(L_1\) splitting rule and highest density region (HDR) method. A list containing lower and upper bounds of prediction interval for each test observation. There may be multiple PIs for a single observation.
Prediction intervals for test data with \(L_1\) splitting rule and contiguous HDR method. A list containing lower and upper bounds.
Prediction intervals for test data with shortest PI (SPI) splitting rule and classical method (LM). A list containing lower and upper bounds.
Prediction intervals for test data with shortest PI (SPI) splitting rule and shortest PI (SPI) method. A list containing lower and upper bounds.
Prediction intervals for test data with shortest PI (SPI) splitting rule and quantiles method. A list containing lower and upper bounds.
Prediction intervals for test data with shortest PI (SPI) splitting rule and highest density region (HDR) method. A list containing lower and upper bounds of prediction interval for each test observation. There may be multiple PIs for a single observation.
Prediction intervals for test data with shortest PI (SPI) splitting rule and contiguous HDR method. A list containing lower and upper bounds.
Bias-corrected random forest predictions for test data.
Random forest predictions for test data with least-squares (LS) splitting rule.
Random forest predictions for test data with \(L_1\) splitting rule.
Random forest predictions for test data with shortest PI (SPI) splitting rule.
If available, true response values of the test data.
Otherwise, NULL.
Object of class formula or character describing
the model to fit.
Training data of class data.frame.
Test data of class data.frame.
Confidence level. (1 - alpha) is the desired coverage
level. The default is alpha = 0.05 for the 95% prediction interval.
Number of trees. The default is num.trees = 2000
Number of variables randomly selected as candidates for splitting a node. The default is rounded up \(px/3\) where \(px\) is the number of variables.
pibf rfpi
plot.rfpredinterval print.rfpredinterval
# \donttest{
## load example data
data(BostonHousing, package = "RFpredInterval")
set.seed(2345)
## define train/test split
testindex <- 1
trainindex <- sample(2:nrow(BostonHousing), size = 50, replace = FALSE)
traindata <- BostonHousing[trainindex, ]
testdata <- BostonHousing[testindex, ]
## construct 95% PI with 16 methods for the first observation in testdata
out <- piall(formula = medv ~ ., traindata = traindata,
testdata = testdata, num.trees = 50)
# }
Run the code above in your browser using DataLab