TL;DR
Expectile regression fits a prediction by penalising each error with a squared size, but it charges errors on one side of the prediction a different weight than errors on the other side. Choose a number between 0 and 1, and the fitted value settles where the weighted errors balance, with a fraction of the weight pulling each way. At both sides count equally and you get the ordinary average or least-squares line.
The method is a smooth, convex relative of quantile regression: it keeps the squared penalty of least squares and only adds the asymmetry.
Builds on: Conditional Expectation, Empirical Risk Minimization, Linear Regression · Leads to: asymmetric risk measures and the expectile loss used in some reinforcement-learning methods
Where it's used
Econometrics and wage and income modelling. Economists want to know how a spread changes with a predictor, not only the average. Expectile regression fits the upper or lower side of a conditional distribution with a smooth loss, so the coefficients can be found with the same kind of numerical solver used for least squares.
Risk measurement in finance. A bank that must hold capital against large losses cares about the bad tail of a return distribution. Expectiles of the loss distribution give a single number that moves with the tail and, unlike the usual quantile-based measure, respond smoothly to every observation.
Offline reinforcement learning. Implicit Q-learning needs a value close to the best action's value, but only data from actions that were actually taken is available. It uses an asymmetric squared loss, an expectile with close to 1 (the paper's figure uses 0.9), so that the learned value leans toward the good outcomes in the data without ever querying the best action directly.
How it works
Take one tiny set of observations, , and a of . We want the number that the asymmetric loss prefers.
- Pick the weights. An error is weighted by when is above , and by when is below . Check: the two weights add to 1, and the bigger weight goes to the side you should be more afraid of missing.
- Try , the ordinary mean. The point is below , so its weight is ; its squared error is , giving . The point is above, so its weight is ; its squared error is , giving . Total loss: .
- Try . The point has weight and squared error , giving . The point has zero error. Total loss: . Both extremes are worse than the midpoint.
- Try . The point gives . The point gives . Total loss: , the smallest of the three.
- Read off the answer. The loss is lowest at . This is the -expectile of . It is above the mean , because the loss tilts the answer toward the side with the larger weight.
The math
The asymmetric loss
Write for an error. The asymmetric squared loss is
Here is the weight, which depends only on the sign of the error. Positive errors (the observation is above the prediction) cost per unit of squared size; negative errors cost .
For a random variable and a number strictly between 0 and 1, the -expectile of is the value that minimises .
Step 2 in symbols: the balance condition
Set the derivative of the expected loss in to zero. Each term contributes , so the first-order condition is
where keeps only the positive part. In words: the weighted size of the observations above must equal the weighted size of the observations below .
For a sample the same condition reads
Check with and the sample . Try . The left side is . The right side is . The two sides match, so is the mean. Setting makes the condition symmetric, and the balance point is the average.
Step 3 in symbols: the regression version
For a linear model fitted to pairs , minimise
Write the residual and the weight . The gradient is . Set it to zero and freeze the weights for a moment: the equation becomes the normal equations of weighted least squares, , with the diagonal matrix of the . Because the weights depend on the residuals, the solver alternates: recompute the weights from the current residuals, solve the weighted problem, and repeat. Every step is an ordinary least-squares solve, so the method is as easy to implement as Linear Regression, with the extra step of updating the weights.
- tau = 0.5
- tau = 0.75
Worked examples
The data are and .
- The balance condition is .
- Assume lies between 0 and 4. Only is above , and only is below it.
- The left side is .
- The right side is .
- Set them equal: , so .
- Check that lies between 0 and 4. It does. Check the balance: and .
Interpretation: the -expectile is , which is above the mean . Only one of the two points is below , so the expectile sits closer to the larger value than the mean does.
The data are . Compare with .
- For we already found above, the mean of the data.
- For , try between 3 and 10. Only is above , and are below it.
- The left side is .
- The right side is .
- Set them equal: , so and .
- Check that lies between 3 and 10. It does. Check the balance: and .
Interpretation: raising from to moves the balance point from the mean to . The one large value at now pulls harder than the three small values push back.
A bank records how long customers wait, in minutes, at two counters. Counter A has waits ; counter B has waits . A manager wants the -expectile for each counter, which leans toward long waits without needing the full distribution.
Counter A:
- Assume lies between 3 and 5. Only is above ; and are below.
- The left side is .
- The right side is .
- Set them equal: , so and .
- Check that lies between 3 and 5, and that the balance holds: and .
Counter B:
- Assume lies between 4 and 8. Only is above ; is below.
- The left side is .
- The right side is .
- Set them equal: , so .
- Check the balance: and .
Interpretation: counter A has a mean of minutes and an -expectile of about . Counter B has a mean of and an -expectile of . The expectile places the typical high wait well above the average, and counter B's long wait makes its expectile move further up than counter A's does.
Try it: counter C has waits . Find its -expectile, assuming lies between 5 and 9, and check the balance. Answer: . Only is above ; the left side is , and the right side is . The mean of counter C is 5, so the expectile is 2 minutes higher.
Common mistakes and tradeoffs
"An expectile is a quantile." It is tempting to think that means three quarters of the data fall below the fitted value. In fact that is only true for quantiles. For at the expectile is , but half the data (the point ) lies below it. Quantiles minimise a loss that grows linearly with the error; expectiles minimise a loss that grows with the square of the error. At the two families also disagree: for the median is but the expectile is the mean, .
"A larger tau means a more accurate model." The parameter does not measure accuracy. It sets how much you dislike underprediction compared with overprediction. A large is the right choice when missing on the low side is expensive, and the wrong choice when both sides cost the same.
"Expectiles are robust to outliers because they are asymmetric." The squared loss still lets one extreme value pull the fitted value a long way, just as it does for the mean. If you need protection against outliers, quantile regression with the absolute-error loss is the safer choice.
When to use it. Use expectile regression when you want a smooth, convex loss that is easy to optimise with the same tools as least squares, and when a balance-of-squared-errors interpretation fits the problem. It is also the natural choice when you need several expectiles that vary continuously with .
When not to use it. Do not use it when the decision depends on an exact fraction of outcomes falling below a threshold, such as a service level or a regulatory quantile. Use quantile regression there. Do not use it for heavy-tailed data without thinking about the squared penalty, which can make the fit depend on a few points.
History
Least squares was the default for fitting trends long before anyone asked about asymmetry. Economists in the late 1980s began to use asymmetric squared losses to study how conditional spreads move with covariates, and the method was formalised in econometrics as asymmetric least squares by Newey and Powell. The name "expectile" comes from the analogy with quantiles: the expectile is the value determined by a balance of weighted squared errors, as the quantile is determined by a balance of weighted absolute errors.
The method caught on because it turned a non-smooth problem into a smooth one. Quantile regression is solved by linear programming; expectile regression can be solved by repeated least-squares steps, which made it easy to adopt. Later it reappeared in finance as a risk measure and in machine learning as a loss for learning high-value estimates from offline data.
Recap
- An expectile is the balance point of squared errors, where errors above the value cost and errors below cost .
- The balance condition holds at the expectile; gives the mean.
- In regression the weights depend on the residuals, so the solver alternates between weighting and weighted least squares.
- Expectiles differ from quantiles: the loss is squared rather than absolute, so the expectile is not a fraction of the data.
- Read next: quantile regression for the absolute-loss counterpart, and implicit Q-learning for the expectile loss in practice.
Check yourself
QuestionRecall: what expectile does tau = 0.5 give, and why?Show answer
The mean. With the weights on positive and negative errors are equal, so the balance condition reduces to the zero-mean condition , whose solution is .
QuestionCompute: the data are and tau = 0.75. Find the 0.75-expectile.Show answer
Assume lies between 0 and 6. The balance is , so and . The check passes: and . The answer is , which is above the mean .
QuestionWhy: why does the weight in the loss depend on the sign of the error, and not on its size?Show answer
The loss is designed to penalise one side of the prediction more than the other, not to penalise large errors more than small ones. The sign tells you which side the observation is on, so the weight or is chosen by the side. The size still enters through the squared term, which keeps the loss smooth and convex.
QuestionApplied: a model that forecasts electricity demand tends to underpredict on peak days, and underpredicting causes blackouts. Should you choose tau above or below 0.5, and why?Show answer
Above 0.5. A larger puts more weight on errors where the observation is above the prediction, which is exactly underprediction. The fitted value is pulled up, so the model errs on the side of over-supplying. The choice of should follow the relative cost of the two kinds of mistake.