Discrepancy function
# Discrepancy function

In structural equation modeling, a discrepancy function is a mathematical function which describes how closely a structural model conforms to observed data; it is a measure of goodness of fit. Larger values of the discrepancy function indicate a poor fit of the model to data. In general, the parameter estimates for a given model are chosen so as to make the discrepancy function for that model as small as possible. Analogous concepts in statistics are known as goodness of fit or statistical distance, and include deviance and divergence.

## Examples

There are several basic types of discrepancy functions, including maximum likelihood (ML), generalized least squares (GLS), and ordinary least squares (OLS), which are considered the "classical" discrepancy functions. Discrepancy functions all meet the following basic criteria:

* They are non-negative, i.e., always greater than or equal to zero.
* They are zero only if the fit is perfect, i.e., if the model and parameter estimates perfectly reproduce the observed data.
* The discrepancy function is a continuous function of the elements of S, the sample covariance matrix, and Σ(θ), the "reproduced" estimate of S obtained by using the parameter estimates and the structural model.

In order for "maximum likelihood" to meet the first criterion, it is used in a revised form as the deviance.

