[[File:Comparison of loss functions.png|thumb|Comparison of common loss functions used for regression]]
==ExampleExamples==
===Regret===
using [[Iverson bracket]] notation, i.e. it evaluates to 1 when <math>\hat{y} \ne y</math>, and 0 otherwise.
===Two-parameter loss function===
Especially in trading where there is a [[Bid–ask_spread|spread]] in which any price is correct, and the "correct" value can be anywhere between bid and ask inclusive, as follows:
<math>L = \frac{abs(x - a) + abs(x - b) - (b-a)}{2}</math>
where <math>L</math> is the two-parameter (or ranged) loss function, <math>a</math> is the high value parameter, <math>b</math> is the low value parameter, and <math>x</math> is the unknown value.
For example, if bid is 1.20 and ask is 1.26, deals can be any value between these two, including them (i.e. 1.20, 1.21, 1.22, 1.23, 1.24, 1.25 and 1.26).
This can also be easily applied to any kind of measurement. Also correlates to quadratic function by <math>L^2</math>.
This function is unpublished.
==Constructing loss and objective functions==
|