Module 2 Sampling variation, Monte Carlo simulation, and the Central Limit Theorem

2.1 Why this module

Module 1 asked how to describe one column of daily weather and how to attach probabilities to events using counts and a normal approximation. The natural next question is stability: if you could draw a different sample of the same size from the same underlying process, how much would your answers move? That variation is not a spreadsheet bug. It is the subject of this module.

You will treat a long list of cleaned station days as a finite teaching population, draw many random samples with replacement, record the sample mean each time, and study the histogram of those means. That construction is Monte Carlo simulation. It makes the Law of Large Numbers (LLN) and the Central Limit Theorem (CLT) visible without asking you to prove anything. You stay on NOAA GHCN-Daily data for the main story, with one optional toy population so the CLT contrast is unmistakable.

2.2 What you will be able to do

By the end of this module you should be able to:

  1. Distinguish a population parameter (for example, the mean of a long reference list) from a sample statistic computed from one draw (for example, the sample mean \(\bar{x}\) from \(n\) days).
  2. Explain sampling variation in plain language: the statistic changes when the random sample changes.
  3. Build an empirical sampling distribution of \(\bar{x}\) by repeating simple random sampling with replacement many times in Excel.
  4. Summarize that sampling distribution with a histogram, a mean of simulated \(\bar{x}\) values, and a standard deviation of simulated \(\bar{x}\) values (the Monte Carlo standard error of the mean across replications).
  5. State the Law of Large Numbers in operational terms for this lab: larger \(n\) makes a single sample mean sit closer to the population mean, in a sense you can see from the simulation.
  6. State the Central Limit Theorem in operational terms: the distribution of \(\bar{x}\) becomes more bell shaped as \(n\) grows, even when the parent population histogram is not bell shaped.
  7. Name one reason daily weather within a month is not truly independent, and one reason we still use random sampling with replacement as a teaching model aligned with STAT2200 Chapter 8.

2.3 Tools and prerequisites

Tools: Microsoft Excel for the hands-on lab, a web browser for NOAA Climate Data Online if you extend the population window.

Prerequisites: completion of Module 1 or equivalent comfort with GHCN-Daily cleaning, TMAX, histograms, and Excel summaries (AVERAGE, STDEV.S, COUNT). This module uses INDEX and RANDBETWEEN. On a Mac, confirm that calculation is set to automatic and that you know how to force a full recalculation after edits (for example the recalculate shortcut in your Excel version, often F9).

2.4 NOAA data for this module

Reuse GHCN-Daily from NOAA Climate Data Online, please pick one station and clean July TMAX for one station across a syllabus-defined 15-year range, so that the \(N_{\text{pop}}\) is large enough for resampling).

  • Portal: NOAA GHCN-Daily, Climate Data Online.
  • Core variables: TMAX (required), PRCP or \(\log(1+\text{PRCP})\) (optional skewed parent), TMIN (optional).
  • Units: match Module 1 (whole degrees Fahrenheit versus tenths).

2.5 1. Population, sample, parameter, statistic

Fix one GHCN-Daily station and one season window you will defend in writing. A concrete choice that works well in class is all available July days across many years after cleaning. Call the cleaned list of \(N_{\text{pop}}\) daily highs. It is a finite list, not a philosophical infinite population.

Two numbers describe that list as a reference:

\[\mu_{\text{pop}} = \frac{1}{N_{\text{pop}}}\sum_{i=1}^{N_{\text{pop}}} x_i, \qquad \sigma_{\text{pop}} = \sqrt{\frac{1}{N_{\text{pop}}}\sum_{i=1}^{N_{\text{pop}}}(x_i-\mu_{\text{pop}})^2}.\]

Use the Excel population standard deviation STDEV.P for \(\sigma_{\text{pop}}\) on that full list. Module 1 used the sample formula STDEV.S when the goal was inference from one small sample. Here the entire cleaned column is the object under study, so the population divisor matches the teaching definition above.

A simple random sample with replacement of size \(n\) draws \(n\) rows from that list independently, each row equally likely, duplicates allowed. Compute the sample mean

\[\bar{x} = \frac{1}{n}\sum_{j=1}^{n} x_j.\]

Read \(\mu_{\text{pop}}\) as the long run average daily high across every July day in the reference list. Read \(\bar{x}\) as the average high across the \(n\) days fortune handed you in one draw. They need not match for small \(n\). The mismatch is sampling error in informal language.

2.6 2. Sampling distribution

Imagine repeating the entire procedure \(M\) times: each time, draw a fresh sample of size \(n\), compute \(\bar{x}\), write the number down. The histogram of those \(M\) values is a Monte Carlo approximation to the sampling distribution of \(\bar{x}\) for that population and that \(n\).

Three objects should stay separate in your head:

  • The histogram of raw daily TMAX in the population list (wide spread, possibly skewed).
  • One sample of size \(n\) and its single number \(\bar{x}\) (one dot on the horizontal axis if you like).
  • The histogram of many \(\bar{x}\) values from many reruns (narrower, more bell shaped for moderate \(n\)).

The standard deviation of the \(M\) simulated \(\bar{x}\) values is not \(\sigma_{\text{pop}}\). It measures how far \(\bar{x}\) wobbles from replicate to replicate. Compare its size when \(n\) is small to when \(n\) is large.

2.7 3. Monte Carlo design choices you must document

Your lab writeup should answer these design questions in one short paragraph:

  1. What exact rows define the population list (station ID, month filter, year range, missing value rule)?
  2. What is \(n\) for each experiment you run? The module requires at least two distinct values of \(n\), one small and one larger.
  3. How many Monte Carlo replications \(M\) did you use? \(M\) in the low hundreds is enough to teach the shape; thousands smooth the histogram at the cost of file size.
  4. Did you sample with replacement? The instructions below assume yes, to match the usual STAT2200 treatment of repeated experiments.

Random sampling with replacement treats each July day in the list as equally informative and independent across draws. Real consecutive days are correlated (heat waves, fronts). This module still uses replacement sampling because it is the clean path to the sampling distribution ideas in STAT2200 Chapter 8. A more advanced course would discuss blocks, autoregression, or stratification. Name the limitation honestly in your interpretation.

2.8 4. Law of Large Numbers, one sentence at a time

Operational version for this workbook: when \(n\) is large, a single draw’s \(\bar{x}\) is likely to fall very close to \(\mu_{\text{pop}}\). You should see that in two ways:

  • The histogram of \(\bar{x}\) from many simulations concentrates tighter around \(\mu_{\text{pop}}\) when you increase \(n\).
  • The average of the \(M\) simulated \(\bar{x}\) values (call it \(\overline{\bar{x}}\)) should sit near \(\mu_{\text{pop}}\) for both values of \(n\), with deviations mostly coming from Monte Carlo noise if \(M\) is modest.

Do not confuse the Law of Large Numbers with the Central Limit Theorem. The first talks about where one average lands as \(n\) grows. The second talks about the entire shape of the distribution of \(\bar{x}\) across many samples.

2.9 5. Central Limit Theorem, one sentence at a time

Operational version: for many parent populations, if \(n\) is not tiny, the histogram of \(\bar{x}\) across repeated samples looks roughly bell shaped even when the raw daily histogram does not. The mean of that bell sits near \(\mu_{\text{pop}}\). The spread shrinks as \(n\) grows.

You will demonstrate the CLT on TMAX and, if your instructor assigns the extension, on a skewed teaching column such as July PRCP with a long right tail, and on a toy uniform population built from RAND in Excel.

2.10 6. Optional extension: skewed and uniform parents

Skewed parent: build a second population sheet of cleaned July PRCP (or \(\log(1+\text{PRCP})\) after you add one to avoid undefined logs). Repeat the same Monte Carlo layout. The raw PRCP histogram often piles at zero with a spike. For small \(n\), the histogram of \(\bar{x}\) can retain skew. For larger \(n\), the histogram of \(\bar{x}\) tends toward a symmetric bell.

Uniform toy parent: on a sheet named UniformPop, place =RAND() in cells A2:A5001 and then copy, paste values only, so the numbers stop changing. Treat those 5000 numbers as a fixed artificial population. Run the same sampling experiment. The parent histogram is flat on its support, yet the histogram of \(\bar{x}\) still becomes more bell shaped as \(n\) grows.

2.11 Worked interpretation, one comparison

Suppose \(\mu_{\text{pop}} = 86.0\) °F for your July TMAX teaching list, with a right skewed daily histogram. With \(n = 10\) and \(M = 400\), you might see a Monte Carlo standard deviation of simulated \(\bar{x}\) near 1.2 °F. With \(n = 40\) under the same setup, that same spread might fall near 0.6 °F. The ratio is not always exactly \(\sqrt{4}\) because the population is finite and days are not truly independent, but directionally the spread of \(\bar{x}\) shrinks as \(n\) grows. The histogram of \(\bar{x}\) for \(n = 40\) should look closer to a symmetric bell than the histogram of \(\bar{x}\) for \(n = 10\).

2.12 Hands-on lab: Monte Carlo sampling distribution of July TMAX

Build a workbook with sheets named exactly Cover, Population, Sim_small_n, and Sim_large_n. Replace every N_pop in the narrative with the actual count of population rows after cleaning. Pick a small \(n_{\text{small}}\) (for example 10) and a larger \(n_{\text{large}}\) (for example 40) with \(n_{\text{large}} \le N_{\text{pop}}\).

2.12.1 Sheet Cover

List station ID, month filter (July only), year range, units, missing value rule, your choices of \(n_{\text{small}}\), \(n_{\text{large}}\), and \(M\) (number of Monte Carlo rows), and one sentence stating that all random draws use sampling with replacement.

2.12.2 Sheet Population

Row 1 holds headers. Put ascending dates in column A if you like, cleaned July TMAX in column B. No formulas required in column B beyond cleaning. Let Population!B2:B_{N_pop+1} be the data range. In Cover or Population, record:

Cell Label Formula
(choose) N_pop =COUNT(Population!B2:B100000) after you expand the range safely
(choose) | mu_pop | =AVERAGE(Population!B2:B_{N_pop+1}) |
(choose) | sigma_pop | =STDEV.P(Population!B2:B_{N_pop+1}) |

Use the real last row in place of the placeholder B_{N_pop+1}.

2.12.3 Sheet Sim_small_n

This sheet holds \(M\) Monte Carlo replicates for sample size \(n_{\text{small}}\). Let \(K = n_{\text{small}}\).

Layout for replicate \(r\) on row \(r+1\) (rows \(2\) through \(M+1\)). Fix a starting column for draws (column B is a natural choice). Place the \(K\) independent draws in that row across \(K\) consecutive columns (columns B through the column that is \(K\) steps to the right). In the next column to the right, place the sample mean \(\bar{x}\) for that replicate.

Assume N_pop lives in Population!D1 (you may place it anywhere documented on Population). Example pattern for the first draw cell at row 2, column B, if Population values sit in Population!$B$2:$B$8000:

=INDEX(Population!$B$2:$B$8000,RANDBETWEEN(1,Population!$D$1))

Fill that pattern across \(K\) columns in row 2, then fill down through row \(M+1\). Each row is one full sample of size \(K\).

Label the mean column xbar. In row 2 of that column:

=AVERAGE(B2:__)

where __ is the cell address of the last draw in row 2 (same row, last draw column). Fill down through row \(M+1\).

Summary block at the top of the sheet or in a dedicated area:

Label Formula
Mean of simulated xbar =AVERAGE( column of xbar )
SD of simulated xbar =STDEV.S( column of xbar )
Min of simulated xbar =MIN( column of xbar )
Max of simulated xbar =MAX( column of xbar )

Build a histogram of the xbar column. Compare its center to mu_pop and its spread to sigma_pop / SQRT(K) as a rough theoretical benchmark for an infinite independent population. Expect only rough agreement here because the list is finite and weather days are correlated.

2.12.4 Sheet Sim_large_n

Repeat the same layout with \(K = n_{\text{large}}\) and its own xbar column and histogram. Widen columns as needed so every row still contains \(K\) independent INDEX/RANDBETWEEN draws before the average.

2.12.5 What to compare in writing

  1. Side by side histograms of raw Population TMAX and of xbar from Sim_small_n.
  2. The same pair for Sim_large_n versus population.
  3. Two sentences on LLN: how tightening spread of xbar as \(n\) grows connects to “a bigger sample mean sits closer to \(\mu_{\text{pop}}\).”
  4. Two sentences on CLT: how the histogram of xbar looks more symmetric than the parent histogram, especially for larger \(n\).
  5. One sentence on the independence assumption and weather.

2.13 Self-check questions

Answer these in your own words before turning anything in:

  1. What is the difference between \(\sigma_{\text{pop}}\) and the standard deviation you compute across many simulated \(\bar{x}\) values?
  2. Why must each Monte Carlo row contain \(n\) separate RANDBETWEEN draws before you take AVERAGE?
  3. If you doubled \(M\) but kept \(n\) fixed, what would change about the histogram of \(\bar{x}\), and what would stay the same?
  4. Why is sampling with replacement the default here even though a calendar day happens only once in history?

2.14 Deliverables

Submit one PDF or workbook that contains:

  1. The Cover sheet with design choices and the independence caveat.
  2. The Population sheet with \(N_{\text{pop}}\), \(\mu_{\text{pop}}\), and \(\sigma_{\text{pop}}\).
  3. Sim_small_n and Sim_large_n with formulas visible for at least the first two data rows, the summary block, and both histograms of xbar.
  4. A short paragraph (four to six sentences) that explicitly uses the phrases sampling distribution, Law of Large Numbers, and Central Limit Theorem.

2.15 Assignment

Replicate the instructor walkthrough with your assigned station and the population window stated in the syllabus. Use the course values of \(n_{\text{small}}\), \(n_{\text{large}}\), and \(M\). Submit the deliverables list above in the course template by the posted deadline.

2.16 Optional depth, for students who want more

  1. Track the sample standard deviation \(s\) in each Monte Carlo row (use STDEV.S across the \(n\) draws in that row). Plot the histogram of \(s\) for two values of \(n\). Comment on stability relative to \(\sigma_{\text{pop}}\).
  2. Replace RANDBETWEEN sampling with Excel’s Data Analysis sampling tool if your instructor prefers it, and verify you still get the same qualitative CLT pictures.
  3. Read one short section of your STAT2200 notes on the sampling distribution of \(\bar{x}\) when the population is normal, and compare the rough sigma_pop / SQRT(n) benchmark to your Monte Carlo SD of xbar.
  4. Persistence reminder from Module 1: if consecutive July days are positively correlated, the true variance of a mean of \(n\) consecutive days can differ from the variance of a mean of \(n\) independent draws. Name one real weather pattern that would inflate correlation.

2.17 Looking ahead

Module 3 turns the spread of \(\bar{x}\) into a stated margin of error: confidence intervals and the language of repeated sampling under a model. The Chapter 8 extension in STAT2200 that moves from “range of the sample mean when \(\sigma\) is known” to “what changes when parameters are unknown” is the bridge you are building with this simulation.

2.18 Instructor note

Publish fixed values of \(N_{\text{pop}}\) bounds (for example July 1991 through 2020 for one station), \(n_{\text{small}}\), \(n_{\text{large}}\), and \(M\), plus a starter workbook with Population blank and formulas prefilled in the first two simulation rows. Pre-seeding RANDBETWEEN ranges avoids off-by-one errors when students paste down. If files become slow at large \(M\), suggest \(M = 300\) as a minimum that still shows CLT.