Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 6

Samples, Populations, and Statistical Inference

Recommended resources

Hello! Welcome to the final lesson of our first module, "Foundations: Probability & Statistics."

In the last lesson, we explored stochastic processes, the mathematical framework for modeling systems that evolve randomly over time, like asset prices. We established that a historical price chart is just one "sample path" from an infinite set of possibilities described by the underlying process.

This brings us to a crucial point: in the real world, we never get to see the entire process or the full range of possibilities. We only have access to a limited, finite set of historical data. This finite dataset is our window into the market's behavior.

Today's lesson addresses this fundamental challenge. Our learning outcome is to differentiate between a sample and a population and explain the concept of statistical inference. This is the cornerstone of all data-driven decision-making in quantitative finance. We'll learn how to use the data we have to make intelligent statements about the reality we want to understand.


1. Population vs. Sample: The Ideal and the Real

In statistics, these two terms have precise meanings. Let's start with clear definitions.

Population vs Sample

This short video from 365 Data Science provides an excellent, concise introduction to the concepts of population and sample.

Watch the first minute and a half of the video (00:00 - 01:33). Focus on the core definitions of population and sample, the notation used (N vs. n), and the practical reasons why we almost always work with samples.

To place this in our context:

  • Population: This is the entire group we want to draw conclusions about. In finance, the "population" is often a conceptual one. It could be all possible daily returns a crypto asset could ever generate, as described by the true underlying stochastic process we discussed in the last lesson. It is infinitely large and includes the future, making it impossible to observe directly.

  • Sample: This is the specific group from which you collect data. For us, a sample is the historical data we can download, for example, the daily closing prices of BTC/USDT from Binance for the last five years. It's a finite, concrete subset of the population.

Population vs. Sample: The Foundation of Statistical Inference
This diagram illustrates the relationship. We use a sample (the smaller group) to perform **statistical inference** about the properties of the entire population (the larger group). Probability, conversely, describes the chance of drawing a certain sample from a known population.

The main reason we use samples is necessity and practicality. It is simply impossible to collect data on every potential outcome. Your experience designing and managing large-scale data systems will make it clear that even if we could access an infinite data stream, processing it would be computationally intractable. We must work with manageable datasets.



2. Describing the Ideal and the Real: Parameters and Statistics

When we measure a characteristic of a population or a sample, we use different terms. This distinction is critical.

  • A Parameter is a value that describes a characteristic of a population. For example, the true mean return () or true volatility () of an asset are parameters. We can model them, but we can never know their exact values.
  • A Statistic is a value that describes a characteristic of a sample. The average return () or standard deviation () that we calculate from our historical data are statistics.

We use sample statistics as estimates of the true population parameters.

Population vs. Sample and Point Estimation
This image shows how a statistic from a sample (the 'point estimate', p-hat) is used to estimate an unknown parameter of the population (p).

The following video clip clarifies this distinction in a financial context.

2015 CFA Level I Quant: Sampling and Estimation

This clip from an IFT video for the CFA curriculum clearly defines parameters and statistics using the example of stock returns.

Watch the segment from 00:00 to 01:34. Pay close attention to the distinction between the population mean (\mu) and the sample mean (\bar{x}).

So, when we use the Arithmetic Brownian Motion model from our last lesson, , the and are population parameters. When you download a year's worth of price data and calculate the mean and standard deviation of daily returns, you are calculating sample statistics—your best guess for the true and .



3. Statistical Inference: The Bridge of Logic

You now know we have a sample, and we want to know about the population. How do we bridge this gap? The answer is statistical inference.

Statistical Inference is the process of using data from a sample to draw conclusions or make predictions about a population.

This is the very essence of quantitative trading. We don't analyze historical data just for fun; we do it to infer something about the future behavior of an asset or a strategy.

Population vs. Sample | Definitions, Differences & Examples

To formalize this, please read a few short sections from the article "Population vs. Sample" by Scribbr. This will solidify the definitions and introduce the key challenge of inference.

Please read the sections titled "Collecting data from a sample" and "Population parameter vs. sample statistic". Focus on how sample data is used to make estimates or test hypotheses about a population, and understand the definition of "sampling error."

Sampling Error: The Unavoidable Gap

As the article mentions, a crucial concept in inference is sampling error. This is the difference between a sample statistic and the true population parameter. It doesn't mean you made a mistake; it's a natural consequence of not observing the entire population.

For example, your backtest on five years of data might show a strategy has an average annual return of 15% (a sample statistic). But its true, long-run average return (the population parameter) might be only 10%. The 5% difference is the sampling error. A central goal in quantitative analysis is to understand and manage this error. You can reduce it by increasing your sample size, but you can never eliminate it.



4. The Importance of a Good Sample

Statistical inference is only reliable if the sample is a good representation of the population. A non-representative, or biased, sample can lead to dangerously wrong conclusions.

For example, imagine you are testing a stock trading strategy. If your sample of stocks only includes companies that are successful and still exist today, you are ignoring all the companies that went bankrupt. This is called survivorship bias. Your sample is not representative of the whole population of stocks that existed over your test period. Consequently, your strategy's performance will appear much better in your backtest than it would in reality.

We will dive much deeper into specific biases like this in Module 5, but for now, it's important to recognize that the quality of the sample is just as important as the analysis you perform on it.



Conclusion

This lesson wraps up our module on the foundations of probability and statistics. We've built a strong conceptual base, moving from descriptive stats to the dynamic world of stochastic processes, and now to the practical realities of working with data.

Key Takeaways:

  • A population is the complete set of all possible data points you are interested in (e.g., all future returns of an asset), while a sample is a finite subset of that data you actually have (e.g., historical returns).
  • A parameter describes a population (e.g., true mean ), whereas a statistic describes a sample (e.g., sample mean ).
  • Statistical inference is the formal process of using sample statistics to make educated guesses about population parameters. This is the foundation of data-driven decision-making.
  • Sampling error is the inevitable difference between a sample statistic and the population parameter. A key part of a quant's job is to manage this uncertainty.

Preview of the Next Module:

We have now covered the 'why' and 'what' of basic statistical analysis. We understand that we need to compute statistics from samples to infer properties about populations. In our next module, The Quant's Toolkit: Python for Finance, we will begin learning 'how'.

Our very first lesson will introduce NumPy, the workhorse of numerical computing in Python. You'll learn how to perform fast, vectorized operations on arrays of data. These operations are the building blocks for calculating the very sample statistics (like mean, variance, and correlation) we've been discussing, setting the stage for you to start analyzing financial data programmatically.