Skip to contents

Computes rescaled excesses over the conditional quantiles

Usage

get_excesses(
  X = NULL,
  y,
  quantiles,
  intermediate_q_feature = FALSE,
  scale_features = FALSE,
  X_scaling = NULL
)

Arguments

X

A covariate matrix. Can be NULL if there are no covariates.

y

The response variable vector.

quantiles

The intermediate quantiles over which to compute the excesses of y.

intermediate_q_feature

Whether to use the intermediate quantiles as an additional covariate, by appending it to the X matrix (bool).

scale_features

Whether to rescale each input covariates to zero mean and unit variance before applying the network (recommended). If X_scaling is given, X_scaling$scaling overrides scale_features.

X_scaling

Existing "X_scaling" object containing the precomputed mean and variance for each covariate. This enables reusing the scaling choice and parameters from the train set, if computing the excesses on a validation or test set, in order to avoid overfitting. This is performed automatically in the "EQRN" objects.

Value

Named list containing:

  • Y_excessesthematrix of response excesses,

  • X_excessesthe (possibly rescaled and q_feat transformed) covariate matrix,

  • X_scalingobject of class "X_scaling" to use for consistent scaling on future datasets,

  • excesses_ratioand the ratio of escesses for troubleshooting.