Learn R Programming

pintervals (version 1.1.1)

bootstrap_inner: Bootstrap Function for Bootstrapping the Prediction Intervals

Description

Bootstrap Function for Bootstrapping the Prediction Intervals

Usage

bootstrap_inner(
  pred,
  calib,
  error,
  nboot,
  alpha,
  error_type = c("raw", "absolute"),
  distance_weighted_bootstrap = FALSE,
  distance_features_calib = NULL,
  distance_features_pred = NULL,
  distance_type = c("mahalanobis", "euclidean"),
  normalize_distance = c("minmax", "sd", "none"),
  weight_function = gauss_kern
)

Value

a numeric vector with the predicted value and the lower and upper bounds of the prediction interval

Arguments

pred

predicted value

calib

a vector of predicted values for the calibration partition

error

vector of errors

nboot

number of bootstrap samples

alpha

confidence level

error_type

The type of error to use for the prediction intervals. Can be 'raw' or 'absolute'. If 'raw', bootstrapping will be done on the raw prediction errors. If 'absolute', bootstrapping will be done on the absolute prediction errors with random signs. Default is 'raw'

distance_weighted_bootstrap

logical. If TRUE, the bootstrap samples will be weighted according to the distance function

distance_features_calib

a matrix of features for the calibration partition. Used when distance_weighted_bootstrap is TRUE

distance_features_pred

a matrix of features for the prediction partition. Used when distance_weighted_bootstrap is TRUE

distance_type

The type of distance metric to use when computing distances between calibration and prediction points. Options are 'mahalanobis' (default) and 'euclidean'.

normalize_distance

Either "none", "minmax", or "sd". Indicates how to normalize the distances when distance_weighted_bootstrap is TRUE

weight_function

a function to use for weighting the distances. Can be 'gaussian_kernel', 'caucy_kernel', 'logistic', or 'reciprocal_linear'. Default is 'gaussian_kernel'