Statistics

Stock traders are interested in the most probable close price. Common sense says that this should be close to some kind of an average as the price dances around a mean, due to random fluctuations. The arithmetic mean and weighted average are ways to find the center of a distribution of values. However, neither are robust and both are sensitive to outliers. Outliers are extreme values that are much bigger or smaller than the typical values in a dataset. Usually, outliers are caused by a rare phenomenon or a measurement error. For instance, if we have a close price value of a million dollars, this will influence the outcome of our calculations.

Get NumPy : Beginner's Guide - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.