1. Financial data is different: order matters
Level 5: Time series: why the past does not repeat itself the same way
Shuffle a share's daily returns over a whole year at random, and the mean will not move by a single decimal.
Nor will the variance move, nor — surprisingly — the total compounded return at the end of the period. And yet you have just destroyed almost everything an investor cares about.
What the tools you already know assume
In the previous levels you have worked with probability, distributions, means, variances, confidence intervals, correlation and regression.
In their classical formulation, all of them assume something very specific about the data: that the observations are independent and identically distributed, abbreviated in the jargon as i.i.d.
These are two distinct demands, and it is worth separating them before going on:
- Independent means that knowing the value of one observation gives you no clue about the value of the next.
- Identically distributed means that they all come from the same underlying process, with the same mean, the same variance and the same distributional shape.
If you measure the height of a hundred people chosen at random, or roll a die a hundred times, you can shuffle the order of those hundred data points without losing any information: the mean, the variance and the histogram stay exactly the same. For that kind of data, order is an accident with no statistical content.
What shuffling breaks, and what it does not
Financial data ordered in time — daily prices, daily returns, volumes — does not meet that condition, and it is worth being precise about what exactly breaks and what does not.
Go back to the experiment at the start. When you shuffle a share's daily returns over a whole year, these three things do not change at all:
- The arithmetic mean, because it depends only on the set of values, not on the order in which they appear.
- The variance, for exactly the same reason as the mean.
- The total compounded return at the end of the period. Multiplying (1 + day 1's return) by (1 + day 2's return) and so on gives the same result whatever the order, because multiplication is commutative.
What does change radically when you shuffle is everything that depends on the sequence in which the data arrived:
- The particular path the price followed over that year.
- The depth and duration of the falls, that is, the drawdown.
- Whether there were runs of consecutive rises or falls.
- Whether one day's value lets you anticipate anything about the next.
That is the first idea to fix in your mind: there are statistics that are blind to order and statistics that depend entirely on it, and confusing the two is a frequent error.
When a new data point adds less than it seems
The practical problem appears when those consecutive returns are not independent of one another, something that happens frequently in real markets and for fairly recognizable reasons:
- Because a trend runs on for several days in a row.
- Because a news item takes time to be fully incorporated into the price.
- Because a nervous spell generates large swings several days in a row.
When that dependence exists, each new data point carries less genuinely new information than a truly independent data point would, because part of its value was already contained, however weakly, in the earlier data.
The standard error falls short
This has a very concrete consequence for the tools of the inferential statistics level.
The usual formula for the standard error of a mean — the standard deviation divided by the square root of the number of observations — assumes that those observations are independent.
If they are not, that formula understates the real uncertainty. It does not fall short by chance or occasionally: it leaves the interval systematically narrower than it should be.
A numerical example helps to see the scale of the problem. Suppose a share with a daily return standard deviation of 1.2% and a sample of 252 days, that is, one complete trading year.
If you treated those 252 days as independent observations, the standard error of the daily mean would be 1.2% divided by the square root of 252 (roughly 15.9), that is, around 0.075%. That would produce a very narrow 95% confidence interval around the estimated mean return, giving the impression of considerable precision.
But suppose now that those returns have a positive dependence between consecutive days, something that is detected and measured with autocorrelation, the subject of the next module.
The effective number of genuinely independent observations may then be considerably lower than 252: let us say, purely for illustration, about 120.
With that effective sample size, the real standard error would be 1.2% divided by the square root of 120 (roughly 10.95), that is, close to 0.11%. Almost 50% wider than the naive calculation.
The statistical conclusion may change completely between one calculation and the other, for instance whether the mean return is significantly different from zero. Asserting a conclusion without having checked first whether the data are independent is exactly the kind of error that produces false confidence.
A sample of size one
There is also a deeper limitation, almost philosophical in nature, that separates financial statistics from much of classical statistics.
When you study the distribution of heights in a population, there is in principle the possibility of taking many different samples from that same population: you can, conceptually, repeat the sampling experiment as many times as you like. With the market there is no such possibility, because only one history of the S&P 500 has happened.
You cannot rewind 2008 and let it unfold differently a hundred times to see the range of possible outcomes. You have only the single trajectory that actually happened.
The index has close to a century of daily history available, of the order of 25,000 observations if you count the precursors of the modern index. But those observations are not 25,000 independent replications of the same experiment, but 25,000 points of a single chained sequence, with its own regimes, its crises and its biases about which companies survived to be part of the index.
This does not mean that financial statistics is useless, but it does mean that every conclusion should be presented with a very specific humility. It comes from a sample of size one at the level of the complete historical trajectory, not from thousands of possible alternative universes.
Cross-section and time series
It is also worth distinguishing two ways of looking at the same S&P 500 data that are often confused with one another.
Taking the return of the index's 500 companies on one particular day is a cross-section: 500 different entities, observed at the same instant, reasonably closer to independence from one another, though not perfectly so. They are subject, of course, to a common market factor, as you saw in the CAPM in the previous level.
Taking instead the daily return of just one of those companies over 500 sessions is a time series. It is a single entity observed at 500 successive instants, where each observation is causally and statistically entangled with the previous one.
They are different data structures demanding different tools. Applying without more ado the techniques designed for a cross-section — such as an ordinary regression that assumes independent errors — to a time series without adjusting anything is a common source of misleading results in amateur financial analysis.
The vocabulary that comes now
The modules that follow provide the formal vocabulary for handling this kind of data correctly:
- Stationarity, which pins down what it means for the statistical properties of a series not to change over time.
- Autocorrelation, which measures exactly how much dependence there is between consecutive observations.
- The random walk, which formalizes the hypothesis that tomorrow's price is not predictable from today's price.
- Cointegration, which explains when two individually unpredictable series can maintain a stable relationship between them.
- Volatility clustering, which shows that although the direction of the price is hard to predict, the size of its movement is rather less so.
- Rolling windows, which show why none of these properties, once measured, can be taken as guaranteed for ever.