Lably
Skip to content

Loss function

Mathematical relation assigning a probability event to a cost

  • 9 min read
  • 5 chapters
  • 1 lab on Lably
Smooth Mean Absolute Error (SMAE) loss proposed in https://arxiv.org/abs/2303.09935 outperforms the Squared error, Huber and Log-Cosh losses on datasets with significantly many outliers is proposed. T
M.Zkuba · CC BY-SA 4.0

Learn it on Lably

In statistics, typically a loss function is used for parameter estimation, and the event in question is some function of the difference between estimated and true values for an instance of data. The concept, as old as Laplace, was reintroduced in statistics by Abraham Wald in the middle of the 20th century. In the context of economics, for example, this is usually economic cost or regret. In classification, it is the penalty for an incorrect classification of an example. In actuarial science, it is used in an insurance context to model benefits paid over premiums, particularly since the works of Harald Cramér in the 1920s. In optimal control, the loss is the penalty for failing to achieve a desired value. In financial risk management, the function is mapped to a monetary loss.

Examples

Regret

Leonard J. Savage argued that using non-Bayesian methods such as minimax, the loss function should be based on the idea of regret, i.e., the loss associated with a decision should be the difference between the consequences of the best decision that could have been made under circumstances will be known and the decision that was in fact taken before they were known.

Quadratic loss function

The use of a quadratic loss function is common, for example when using least squares techniques. It is often more mathematically tractable than other loss functions because of the properties of variances, as well as being symmetric: an error above the target causes the same loss as the same magnitude of error below the target. If the target is t, then a quadratic loss function is

λ(x)=C(t−x)2

for some constant C; the value of the constant makes no difference to a decision, and can be ignored by setting it equal to 1. This is also known as the squared error loss (SEL).

Many common statistics, including t-tests, regression models, design of experiments, and much else, use least squares methods applied using linear regression theory, which is based on the quadratic loss function.

The quadratic loss function is also used in linear-quadratic optimal control problems. In these problems, even in the absence of uncertainty, it may not be possible to achieve the desired values of all target variables. Often loss is expressed as a quadratic form in the deviations of the variables of interest from their desired values; this approach is tractable because it results in linear first-order conditions. In the context of stochastic control, the expected value of the quadratic form is used. The quadratic loss assigns more importance to outliers than to the true data due to its square nature, so alternatives like the Huber, log-cosh and SMAE losses are used when the data has many large outliers.

0-1 loss function

In statistics and decision theory, a frequently used loss function is the 0-1 loss function

L(y^,y)={0if y=y^1if y≠y^

In information theory, this loss function is known as Hamming distortion.

Cross-entropy loss

For tasks that involve classifying data, especially using neural networks, the cross entropy loss (or log loss) is often preferred to the 0-1 loss function as it is differentiable and provides a larger penalty for overconfident wrong predictions.

L(y,p)=−(ylog⁡p+(1−y)log⁡(1−p)).

Hinge loss

The hinge loss function is used in training classifier models like super vector machines, and is formulated as

L(y,f(x))=max(0,1−y⋅f(x)),

which penalizes predictions that are either incorrect or insufficiently confident.

Sign in to keep reading

4 more chapters are free with a Lably account.

More in Applied mathematics