Learn R Programming

pintervals (version 1.0.1)

grid_inner: Inner function for grid search

Description

Inner function for grid search

Usage

grid_inner(
  hyp_ncs,
  y_hat,
  ncs,
  pos_vals,
  alpha,
  ncs_type,
  distance_weighted_cp,
  distance_features_calib,
  distance_features_pred,
  distance_type,
  normalize_distance,
  weight_function
)

Value

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

Arguments

hyp_ncs

vector of hypothetical non-conformity scores

y_hat

predicted value

ncs

vector of non-conformity scores

pos_vals

vector of possible values for the lower and upper bounds of the prediction interval

alpha

confidence level

ncs_type

type of non-conformity score

distance_weighted_cp

logical. If TRUE, the non-conformity scores will be weighted according to the distance function

distance_features_calib

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

distance_features_pred

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

distance_type

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

normalize_distance

Either 'minmax', 'sd', or 'none'. Indicates how to normalize the distances when distance_weighted_cp 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'