Skip to content

Z-test

A z-test uses a standard-normal reference to test a parameter. Work through a known-volatility mean-return example and separate exact z inference from t-tests and large-sample approximations.

A z-test is a hypothesis test that compares a standardized statistic with the standard normal distribution under the null hypothesis, exactly or approximately. For a mean return, it asks how far the observed average is from a specified mean in units of sampling uncertainty. The important question is whether the standard-normal reference is justified, not merely whether the calculation produces a number called zz.

The clean case: a normal mean with known volatility

Suppose X1,…,XnX_1,\ldots,X_n are independent, identically distributed normal observations with unknown mean μ\mu and known, positive population standard deviation σ\sigma. To test H0:μ=μ0H_0:\mu=\mu_0, use the sample mean Xˉ\bar X and its standard error:
SE⁡(Xˉ)=σn,Z=Xˉ−μ0σ/n.\operatorname{SE}(\bar X)=\frac{\sigma}{\sqrt n}, \qquad Z=\frac{\bar X-\mu_0}{\sigma/\sqrt n}.
Under H0H_0, Z∼N(0,1)Z\sim\mathcal N(0,1) exactly. Normal sampling and known σ\sigma make this true even for a small sample; a large sample is not an extra requirement in this model. The denominator is the uncertainty of the average, not the volatility of an individual return. NIST's process-mean guidance distinguishes this known-SD calculation from the more common estimated-SD case.
With Φ\Phi denoting the standard-normal cumulative distribution function, the observed statistic zz gives these p-values:
Prespecified alternativep-value
μ≠μ0\mu\ne\mu_02{1−Φ(∣z∣)}2\{1-\Phi(\lvert z\rvert)\}
μ>μ0\mu>\mu_01−Φ(z)1-\Phi(z)
μ<μ0\mu<\mu_0Φ(z)\Phi(z)

Choose the alternative before inspecting the result. Switching to a favourable one-sided test afterwards changes the procedure's false-rejection behaviour.

A hypothetical strategy with known risk

For a deliberately idealised example, assume monthly excess returns follow the independent normal model above, with population SD fixed and known to be 2 percentage points. A prespecified sample of 100 months has mean 0.5 percentage points. Test a zero mean against a two-sided alternative:
SE⁡(Xˉ)=2100=0.2 percentage points,z=0.5−00.2=2.5.\operatorname{SE}(\bar X)=\frac{2}{\sqrt{100}}=0.2\text{ percentage points}, \qquad z=\frac{0.5-0}{0.2}=2.5.

The two-sided p-value is

p=2{1−Φ(2.5)}≈0.01242.p=2\{1-\Phi(2.5)\}\approx0.01242.
Under the zero-mean model, about 1.242% of sample averages are at least this far from zero in either direction. This is not the probability that the zero-mean hypothesis is true. The test rejects at a prespecified 5% level, but fails to reject at 1%.
Known-SD normal model with n 100, mean 0.5 pp and SE 0.2 pp: z is 2.5, the two-sided tail probability is 0.01242, and the 95% mean interval runs from 0.108 to 0.892 pp, excluding zero.
Known-SD normal model with n 100, mean 0.5 pp and SE 0.2 pp: z is 2.5, the two-sided tail probability is 0.01242, and the 95% mean interval runs from 0.108 to 0.892 pp, excluding zero.
Original hypothetical monthly-return calculation. Blue tails beyond ±2.5 give the observed p-value; dashed lines at approximately ±1.960 mark the fixed 5% rejection thresholds. The lower panel reports the same evidence in percentage points.
The matching 95% confidence interval is
xˉ±Φ−1(0.975)σn=0.5±1.959964(0.2)≈[0.108, 0.892] percentage points.\bar x\pm\Phi^{-1}(0.975)\frac{\sigma}{\sqrt n} =0.5\pm1.959964(0.2) \approx[0.108,\,0.892]\text{ percentage points}.

Zero lies outside it, agreeing with the two-sided 5% decision. Here rejection means p<αp<\alpha; interval endpoints are included, so a null exactly on an endpoint is not rejected. The interval adds the compatible effect sizes that a significance label alone omits.

When “known” is doing too much work

In actual strategy research, population volatility is usually estimated. Replacing σ\sigma with the sample SD SS changes the exact normal-model statistic to

T=Xˉ−μ0S/n∼tn−1under H0.T=\frac{\bar X-\mu_0}{S/\sqrt n}\sim t_{n-1}\quad\text{under }H_0.
That calls for Student's t-test, with heavier reference tails. Knowing the numerical value of the sample SD does not make the population SD known. A volatility estimate from an earlier window also carries uncertainty and may describe a different regime. MathWorks' z-test documentation explicitly assumes a normal population and known SD.
The name z-test also covers large-sample procedures whose standardized estimator is only approximately normal. For an iid mean with finite positive variance, the central limit theorem, together with a consistent variance estimate, supports an asymptotic normal reference. There is no universal sample-count threshold that guarantees accurate tail probabilities. Dependence, heavy tails and unstable volatility require attention to the sampling law and the standard-error estimate; having many observations alone does not validate S/nS/\sqrt n.
For the transition from exact normal pivots to large-sample inference, Confidence Intervals and Hypothesis Testing develops both calculations and their assumptions. Its preview is public; the full lesson requires membership.
Finally, statistical significance does not establish profitability after costs, a stable future edge or robustness to searching many strategies. Those are separate parts of evaluating a return claim.

Sources

Last updated
  • z test
  • normal mean
  • known variance
  • statistical inference
  • mean returns
← Back to the glossaryBack to top ↑