Log in Sign up
Back to Discover
🔢

Loss function

math Maturity 11-13

Sometimes we make a mistake. We can use math to see how big a mistake is. It tells us if we are a little bit wrong. It also tells us if we are a lot wrong. This helps us do better next time.

Comparison of loss functions.png
Comparison of loss functions.png
Can you try to be right?

53 words

Sometimes we make a mistake. We can use math to see how big it is. This math tool is called a loss function.

Comparison of loss functions.png
Comparison of loss functions.png

It shows the cost of being wrong. A small mistake has a small cost. A big mistake has a big cost.

In some cases, we want to find the best choice. We try to make the loss as small as possible.

Fitting a straight line to a data with outliers.png
Fitting a straight line to a data with outliers.png

In money math, it shows a loss of cash. In other work, it shows a penalty. It helps us learn to do better next time.

102 words

Sometimes we make a guess or a choice. We might not get it right. A loss function is a math tool that measures our mistakes. It turns an error into a single number. This number shows the cost of being wrong.

Comparison of loss functions.png
Comparison of loss functions.png

In math, we often try to minimize this cost. Minimizing means making the number as small as possible. We want to find the best way to do things. In economics, this might show a loss of money. In insurance, it helps model the cost of paying benefits.

Fitting a straight line to a data with outliers.png
Fitting a straight line to a data with outliers.png

One common tool is the quadratic loss function. This is also called squared error loss. It is useful because it is symmetric. This means being too high by a certain amount is the same as being too low by that amount. However, this tool can be tricky. It gives a lot of weight to outliers. An outlier is a piece of data that is very different from the rest. If there are many outliers, experts might use other tools like Huber loss instead. Some people say we should pick tools based on real life. Real life is not always smooth or even. For example, arriving just one minute late for a plane is much worse than arriving early. This is an asymmetric cost because the two sides are not equal.

231 words

Imagine you are trying to guess how many jellybeans are in a jar. If you guess too high or too low, you have made an error. A loss function is a mathematical tool used to measure that error. It turns a mistake into a single number that represents a cost. In math, we call the goal of making this cost as small as possible optimization. If we want to find the best possible answer, we try to minimize the loss.

Comparison of loss functions.png
Comparison of loss functions.png
This idea is used in many different ways. In economics, it might measure a loss of money or regret. In insurance, experts use it to model the cost of paying benefits.
Fitting a straight line to a data with outliers.png
Fitting a straight line to a data with outliers.png

There are different ways to calculate this cost depending on the problem. One common method is called the quadratic loss function. This is also known as squared error loss. It is helpful because it is symmetric. This means being too high by a certain amount costs the same as being too low by that same amount. However, this method has a weakness. It gives a lot of importance to outliers. An outlier is a piece of data that is very different from the rest. If a dataset has many outliers, mathematicians might use different tools like Huber loss or log-cosh loss instead.

People have studied these ideas for a long time. The concept is as old as a mathematician named Laplace. Later, in the middle of the 20th century, Abraham Wald reintroduced these ideas to the field of statistics. Other thinkers like Leonard J. Savage looked at loss through the idea of regret. Regret is the difference between the decision you actually took and the best decision you could have made if you knew everything in advance. This helps people make better choices when they are not sure what will happen.

Math tools can also help solve big real-world problems. A researcher named Andranik Tangian used objective functions to help manage money. He worked on distributing budgets for 16 Westfalian universities. He also worked on subsidies for 271 German regions to help with unemployment. In the 1920s, Harald Cramér used these ideas in insurance science. These numbers show how math helps organize large groups of people and money. Even small changes in a formula can change how a whole system works.

In the real world, things are not always perfectly smooth or even. Some experts, like W. Edwards Deming and Nassim Nicholas Taleb, argue that we should look at real life to pick our math tools. Real life can be asymmetric. For example, arriving a few minutes early for a plane is fine. But arriving just one minute late can mean you miss the flight entirely. This makes being late much more costly than being early. Understanding these different kinds of costs helps us make smarter decisions every day.

483 words

A loss function is a mathematical tool used to measure error. In optimization and decision theory, it maps an event or specific variables onto a real number. This number represents a "cost" associated with that event. When mathematicians solve optimization problems, they seek to minimize this loss function. An objective function is a broader term for these tools. It can be a loss function, or it can be its opposite. In some fields, the opposite is called a reward function, a profit function, or a utility function. While a loss function is minimized, these opposite functions are maximized.

Comparison of loss functions.png
Comparison of loss functions.png

Different fields use loss functions in unique ways. In statistics, they are often used for parameter estimation. Here, the loss is a function of the difference between estimated values and true values. In economics, the function might represent economic cost or regret. In classification tasks, it represents the penalty for an incorrect classification. Actuarial science uses it to model insurance benefits paid over premiums. In optimal control, the loss is the penalty for failing to reach a desired value. Financial risk management even maps these functions directly to monetary loss.

One of the most common tools is the quadratic loss function. This is also known as squared error loss, or SEL. It is often used in least squares techniques. This function is mathematically tractable because of the properties of variances. It is also symmetric. This means an error above a target causes the same loss as an error of the same magnitude below the target. If the target is "t," the loss is calculated using a constant "C." For decision-making, the value of this constant can be ignored by setting it to 1. Quadratic loss is the basis for linear regression theory and many common statistics, such as t-tests.

Fitting a straight line to a data with outliers.png
Fitting a straight line to a data with outliers.png

However, quadratic loss has a specific weakness regarding outliers. An outlier is a data point that is very different from the rest of the set. Because the quadratic loss squares the error, it assigns much more importance to outliers than to the true data. When a dataset contains many large outliers, mathematicians use alternatives. These include the Huber loss, the log-cosh loss, and the symmetric mean absolute error, or SMAE. Another simple option is the 0-1 loss function. In information theory, this specific function is known as Hamming distortion.

History shows how these ideas evolved through different thinkers. The concept is as old as the mathematician Laplace. In the middle of the 20th century, Abraham Wald reintroduced the concept to statistics. Leonard J. Savage also contributed by arguing for the idea of regret. Regret is the difference between the decision actually taken and the best decision that could have been made if the circumstances were known in advance. Later, Andranik Tangian showed that useful objective functions, like quadratic and additive ones, are determined by a few indifference points. He used these to distribute budgets for 16 Westfalian universities and subsidies for 271 German regions.

In statistical theory, there are two main ways to look at expected loss. Frequentist theory looks at the expected value with respect to a probability distribution of observed data. This is often called the risk function. Bayesian theory calculates expectation using a prior distribution of the parameter. The goal in the Bayesian approach is to minimize the Bayes Risk. This involves finding an optimal decision, known as the Bayes Rule. The Bayes Rule is useful because it minimizes the average loss over all possible states of nature. This approach is often more efficient than choosing a frequentist optimal decision rule.

Finally, experts like W. Edwards Deming and Nassim Nicholas Taleb suggest looking at empirical reality. They argue that real-world losses are often not "mathematically nice." Real losses might not be continuous, symmetric, or differentiable. For example, arriving slightly early for a plane has little cost. However, arriving slightly late can have a massive cost because you miss the flight. This is an asymmetric and discontinuous situation. In drug dosing, the cost of too little medicine is a lack of efficacy. The cost of too much might be toxicity. Understanding these real-world complexities helps us choose the right mathematical tools.

703 words
🖼️ Images & Media (2)
File:Comparison of loss functions.png
Comparison of loss functions.png
File:Fitting a straight line to a data with outliers.png
Fitting a straight line to a data with...
Up Next
🔢
Decision theory
Math
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.