Numerical Accuracy

This page explains how to verify the accuracy of MIDAS statistical computations yourself.

NIST Statistical Reference Datasets

NIST Statistical Reference Datasets (StRD) are benchmark datasets published by the National Institute of Standards and Technology for evaluating the numerical accuracy of statistical software. Each dataset comes with certified values computed to 15 significant digits.

NIST StRD has five categories: Univariate, Linear Regression, Nonlinear Regression, ANOVA, and MCMC. This page covers Univariate and Linear Regression, which correspond to features available in MIDAS. MIDAS does not have features corresponding to Nonlinear Regression, ANOVA, or MCMC.

You are not limited to NIST datasets. Any dataset where you know the expected results from R, Python, or another tool can be used for verification.

Verification

Verify with the UI

  1. Download a CSV file from the table below
  2. Open MIDAS and load the CSV
  3. Open a Linear Regression tab and set the response variable y and explanatory variables x based on the column names in the CSV
  4. Compare the displayed coefficients, R-squared, and other statistics against the NIST certified values listed below

How to read the results

The numbers in the tables are Log Relative Error (LRE). LRE is the negated common logarithm of the relative error between the MIDAS result and the NIST certified value, and corresponds to the number of matching significant digits.

LRE=log10computedcertifiedcertified\text{LRE} = -\log_{10} \frac{|\text{computed} - \text{certified}|}{|\text{certified}|}

All browser applications, including MIDAS, compute with IEEE 754 double-precision floating-point numbers. The significand is 52 bits, so the theoretical upper limit for LRE is approximately 15.9.

Univariate Summary Statistics

The mean and standard deviation displayed in the MIDAS Data Table panel were compared against NIST certified values. The standard deviation divides by n1n - 1 (sample standard deviation).

DatasetnLRE(Mean)LRE(SD)
PiDigits50001514.9
Lottery21815.215.7
Lew2001515.2
Mavro501513.1
Michelso1001513.9
NumAcc131515
NumAcc210011514.2
NumAcc3100115.99.5
NumAcc4100115.78.3

Dataset details are published at NIST StRD Univariate.

Linear Regression Datasets

Each dataset was run through MIDAS, and the resulting coefficients, standard errors, R-squared, residual SD, and F statistic were compared against the NIST certified values. The numbers in the table are LRE values for each category. Where a category has multiple parameters, the minimum LRE is shown.

DatasetnLRE(Coef.)LRE(SE)LRE(R²)LRE(Resid. SD)LRE(F)
Norris3612.313.815.513.911.5
Pontius4011.91316139.5
NoInt11114.715.415.715.313.9
NoInt2315.315.81615.514.2
Filip827.37.510.48.27.9
Longley161312.314.312.312
Wampler1219.5exact15exactexact
Wampler22112.6exact15exactexact
Wampler3219.513.61614.411
Wampler4217.813.515.914.815.7
Wampler5215.813.513.714.813.7

Wampler1 and Wampler2 are noise-free data where the model fits the data exactly. All residuals are zero, so SE, residual SD, and F are also zero. "exact" in the table indicates that both the NIST certified value and the MIDAS result are zero.

Model specifications, certified values, and dataset descriptions for all 11 datasets are published at NIST StRD Linear Regression.

Known Limitations

Filip: A 10th degree polynomial with a design matrix condition number around 10610^6. The larger the condition number, the more rounding errors affect the result. The coefficient accuracy is 7 significant digits. Orthogonal polynomials can reduce the condition number by transforming the polynomial basis, but MIDAS does not currently support this.

Wampler5: The highest-noise 5th degree polynomial dataset. The design matrix condition number is large, and the coefficient accuracy is 6 significant digits.

Data Source

Filliben, J. and Possolo, A. (1999). Statistical Reference Datasets. NIST Standard Reference Database 140. National Institute of Standards and Technology. https://doi.org/10.18434/T43G6C