piall {RFpredInterval}R Documentation

Prediction intervals with all methods

Description

Constructs prediction intervals with the 16 methods (PIBF method implemented in pibf() and 15 method variations implemented in rfpi()).

Usage

piall(
  formula,
  traindata,
  testdata,
  alpha = 0.05,
  num.trees = 2000,
  mtry = ceiling(px/3)
)

Arguments

formula

Object of class formula or character describing the model to fit.

traindata

Training data of class data.frame.

testdata

Test data of class data.frame.

alpha

Confidence level. (1 - alpha) is the desired coverage level. The default is alpha = 0.05 for the 95% prediction interval.

num.trees

Number of trees. The default is num.trees = 2000

mtry

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.

Value

A list with the following components:

PIBF

Prediction intervals for test data with PIBF method. A list containing lower and upper bounds.

LS_LM

Prediction intervals for test data with least-squares (LS) splitting rule and classical method (LM). A list containing lower and upper bounds.

LS_SPI

Prediction intervals for test data with least-squares (LS) splitting rule and shortest PI (SPI) method. A list containing lower and upper bounds.

LS_Quant

Prediction intervals for test data with least-squares (LS) splitting rule and quantiles method. A list containing lower and upper bounds.

LS_HDR

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.

LS_CHDR

Prediction intervals for test data with least-squares (LS) splitting rule and contiguous HDR method. A list containing lower and upper bounds.

L1_LM

Prediction intervals for test data with L_1 splitting rule and classical method (LM). A list containing lower and upper bounds.

L1_SPI

Prediction intervals for test data with L_1 splitting rule and shortest PI (SPI) method. A list containing lower and upper bounds.

L1_Quant

Prediction intervals for test data with L_1 splitting rule and quantiles method. A list containing lower and upper bounds.

L1_HDR

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.

L1_CHDR

Prediction intervals for test data with L_1 splitting rule and contiguous HDR method. A list containing lower and upper bounds.

SPI_LM

Prediction intervals for test data with shortest PI (SPI) splitting rule and classical method (LM). A list containing lower and upper bounds.

SPI_SPI

Prediction intervals for test data with shortest PI (SPI) splitting rule and shortest PI (SPI) method. A list containing lower and upper bounds.

SPI_Quant

Prediction intervals for test data with shortest PI (SPI) splitting rule and quantiles method. A list containing lower and upper bounds.

SPI_HDR

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.

SPI_CHDR

Prediction intervals for test data with shortest PI (SPI) splitting rule and contiguous HDR method. A list containing lower and upper bounds.

pred_pibf

Bias-corrected random forest predictions for test data.

pred_ls

Random forest predictions for test data with least-squares (LS) splitting rule.

pred_l1

Random forest predictions for test data with L_1 splitting rule.

pred_spi

Random forest predictions for test data with shortest PI (SPI) splitting rule.

test_response

If available, true response values of the test data. Otherwise, NULL.

See Also

pibf rfpi plot.rfpredinterval print.rfpredinterval

Examples


## 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)



[Package RFpredInterval version 1.0.8 Index]