Nepedia
Back to Discover
Fluent Reader
🔢

Loss function

math Maturity 11-13 Next article →

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
Comparison of loss functions

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
Fitting a straight line to a data with outliers

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.

472 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ 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...
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.