Mincer-Zarnowitz Test

Calculate the Mincer-Zarnowitz test per asset: whether a volatility forecast is unbiased and efficient, judged by regressing the realized variance on the forecast.

A good forecast has an intercept of 0 and a slope of 1: the realized variance is on average what was forecast. A slope below 1 means the forecast moves more than the variance that follows (it overreacts), above 1 that it moves too little. The R-squared shows how much of the variation in the realized variance the forecast explains, the usual way to rank volatility forecasts of the same asset (Andersen and Bollerslev, 1998). The squared return is a noisy measure of the variance, so the R-squared stays low even for a good forecast.

The formula is as follows:

\[\text{Realized Variance}_{t} = r_{t}^{2}\] \[\sigma_{t}^{2} = \lambda \cdot \sigma_{t-1}^{2} + (1 - \lambda) \cdot r_{t-1}^{2}\] \[r_{t}^{2} = a + b \cdot \hat{\sigma}_{t}^{2} + e_{t}\] \[W = D' \cdot \operatorname{cov}\left(\hat{\beta}\right)^{-1} \cdot D\] \[\text{where}\;\; D = \hat{\beta} - \beta_{0}\] \[F = \frac{W}{2}\]

with \(\sigma_{t}^{2}\) the EWMA forecast, lambda = lambda_ (0.94 by default), so the forecast for t uses returns up to t - 1. The rolling forecast is the sample variance (ddof=1) of the window (22 by default) returns up to t - 1. The regression is fitted by least squares with hat(beta) = (a, b)’ and \(\beta_{0}\) = (0, 1)’, so W is the Wald statistic of \(a = 0\) and \(b = 1\), and F is F-distributed with 2 and n - 2 degrees of freedom. cov(hat(beta)) is the ordinary least squares covariance, or the Newey-West covariance with lags lags (0 by default).

Also known as: MZ regression, forecast efficiency test, forecast unbiasedness test.

Example · XOM, CVX, SHEL, BP · 2021 to 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_mincer_zarnowitz_test:

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["XOM", "CVX", "SHEL", "BP"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.econometrics.get_mincer_zarnowitz_test(lags=5)

Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:

Were the forecasts of an autoregressive model with five lags unbiased for the daily returns of ExxonMobil, Chevron, Shell and BP from 2021 to 2025, by the Mincer-Zarnowitz test?

Which returns:

Using Your Own Data

get_mincer_zarnowitz_test runs on any data, not only prices: ratios, economic indicators, yield curves or your own dataset. Pass a DataFrame, a Series or a dictionary of them to Econometrics as data, with the dates in the rows or the columns, and set changes to how its changes are calculated: "percentage", "log", "difference" for rates and ratios, or None when the data are changes already. For example, for the monthly unemployment rates of the United States and Germany:

from financetoolkit import Economics, Econometrics

economics = Economics(start_date="2000-01-01")

unemployment = economics.get_unemployment_rate(
    countries=["United States", "Germany"], period="monthly"
)

econometrics = Econometrics(data=unemployment, changes="difference")

econometrics.get_mincer_zarnowitz_test()

Parameters

get_mincer_zarnowitz_test accepts the following parameters.

ParameterTypeDescriptionExample
periodstrThe data frequency for returns (daily, weekly, monthly, quarterly, or yearly). Defaults to “daily”, since window is expressed in return observations of this frequency."weekly"
methodstrThe volatility forecasting method. Options are: “ewma” (RiskMetrics EWMA), “rolling” (rolling sample variance). Defaults to “ewma”."ewma"
windowintThe rolling window size used by the rolling method, at least 2. Defaults to 22 (approximately one trading month).20
lambda_floatThe decay factor used by the EWMA method. Defaults to 0.94.0.97
lagsintThe Newey-West lags of the covariance of the coefficients, 0 for the ordinary least squares covariance. Defaults to 0.2
include_benchmarkboolWhether to include “Benchmark” among the assets tested. Defaults to False.True
roundingint | NoneThe number of decimals to round the results to. Defaults to None.2
show_columnsstr | list[str] | NoneThe columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column.None, which keeps every column

References

  • Paper Mincer, J.A. and Zarnowitz, V. (1969). “The Evaluation of Economic Forecasts.” In Economic Forecasts and Expectations: Analysis of Forecasting Behavior and Performance, NBER, 3-46.
  • Paper Andersen, T.G. and Bollerslev, T. (1998). “Answering the Skeptics: Yes, Standard Volatility Models do Provide Accurate Forecasts.” International Economic Review, 39(4), 885-905.
  • Library Referenced against statsmodels’ RegressionResults.wald_test
Share