get_discrepancy: Compute Discrepancy Measures

get_discrepancyR Documentation

Compute Discrepancy Measures

Description

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.

Usage

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
)

Arguments

discrepancy_method

A character string specifying the discrepancy method to use. Options are:

"logarithmic_error"

Logarithmic error, suitable for probabilities.

"mean_square_error"

Mean squared error.

"mean_classification_error"

Mean of classification error, suitable for binary outcomes.

"logistic_deviance"

Logistic deviance, computed using a GLM model.

family_string

A GLM family in string (e.g., "binomial") used to compute logistic deviance.

X

A matrix of predictor variables.

Y

A vector or data frame of observed values.

coefs

A vector of coefficients for the GLM model.

est_Y

A vector of estimated values. If not provided, it will be computed using get_glm_mean with the specified family.

Value

A numeric value representing the discrepancy between observed and estimated values.


catalytic documentation built on April 4, 2025, 5:51 a.m.