Home  ·  GlossaryРусский

Least Squares

Least squares is a common way to measure errors in statistical analysis.  The least squares formula is best known for favoring things with a lot of small errors over those with a few large errors.  Least squares keeps track of all errors, even if some are in one direction and some are in the other direction.

For example, assume that you want to evaluate a method to predict stock prices.  For six days you try to predict a value, then compare the predicted value to the actual value.  For five days in a row the prediction is perfect, the error is 0.  On the sixth day the predictions is off by $10.

A = 0² + 0² + 0² + 0² + 0² + 10²
= 0 + 0 + 0 + 0 + 0 + 100
= 100

Then you try a second method of predicting stocks.  This time your predictions are $2 above the real value each of the six days.

B = 2² + 2² + 2² + 2² + 2² + 2²
= 4 + 4 + 4 + 4 + 4 + 4
= 24

A third method predicts values which are $2 above the actual value some days, and $2 below the actual value on other days.

C = 2² + (-2)² + 2² + (-2)² + 2² + (-2)²
= 4 + 4 + 4 + 4 + 4 + 4
= 24

According to least squares, method B is better than method A because the sum of the squares of the errors is lower for method B.  Method B and method C are equally good, according to least squares.

Least squares is most often associated with linear regression.  However, it can also be used to measure errors in other calculations.  The formulas for volatility and standard deviation are almost identical to the equations listed above.

The alerts server uses least squares and related algorithms are used to optimize a variety of models.  These are all internal calculations, and the user does not have to know the details.

See Also

Alerts Server, Algorithm, Linear Regression, Standard Deviation, Statistical Analysis, Volatility

Sample Alerts

What is Trade-Ideas?

Powerful Software that Finds the Best Opportunities in Today's Market In Real-Time!



Sign Up Now


Why Use Trade-Ideas?

Trade Your Best
Want to see a stock that just made a new 60 day high on 2 times normal volume?  How about a cheap stock about to make 52 week highs?  At Trade-Ideas better trading decisions come from letting opportunities come to you with quality, up-to-the-second market information – on your terms.

Trade-Ideas links to your existing tools, like eSignal, Scottrade, E*Trade, Ameritrade and many more updating them with new opportunities as they happen.


Improve the P&L: Opportunity + Discipline
In a tempting market, how do you protect yourself from yourself?  Keep yourself ‘on the path’.  Trade-Ideas enforces trading plans without emotion:
  1. Imagine having the eyes of 7,000 statisticians working at your beck and call
  2. No programming skills required, video help is available on demand
  3. Use pre-defined, proven strategies, custom built by our expert users
Monitor Your Portfolio or Favorite Sector
Trade-Ideas lets you create your own personalized view of the market, so you can watch the data you want, the way you want.
  1. Let Trade-Ideas monitor your portfolio for must see opportunities
  2. Create alert windows, each with their own view of the market, so that you can profit in any market condition
Create an account and get started!

© Copyright 2002-2008, Trade Ideas LLC.  All rights reserved. AddThis Social Bookmark Button
Questions?  Contact us.