This function computes various discrepancy measures between observed and estimated values. It supports different methods including logarithmic error, square error, classification error, and logistic deviance.
get_discrepancy(
discrepancy_method = c("mean_logarithmic_error", "mean_square_error",
"mean_classification_error", "logistic_deviance"),
family_string = NULL,
X = NULL,
Y = NULL,
coefs = NULL,
est_Y = NULL
)
A numeric value representing the discrepancy between observed and estimated values.
A character string specifying the discrepancy method to use. Options are:
Logarithmic error, suitable for probabilities.
Mean squared error.
Mean of classification error, suitable for binary outcomes.
Logistic deviance, computed using a GLM model.
A GLM family in string (e.g., "binomial") used to compute logistic deviance.
A matrix of predictor variables.
A vector or data frame of observed values.
A vector of coefficients for the GLM model.
A vector of estimated values. If not provided, it will be computed using get_glm_mean
with the specified family
.