统计验证 · 独立 oracle验证矩阵:正确性是独立对照的可复现结果,不是自述
统计验证在这里只有一个含义:自己批改作业的统计工具不算已验证。这里每个用户可见数字都对照项目之外的实现,在确定性 fixture 上,以比较前固定的容差。本页展示实时门禁输出。
实时门禁输出
这些行由最近一次 `npm run verify:gate` 产生。参考值在本项目之外计算;TypeScript 引擎从不提供自己的 oracle。
| statistic | oracleKind | oracle | refValue | tolerance | fixtureId | status |
|---|---|---|---|---|---|---|
| acf | library | statsmodels 0.14.4statsmodels.tsa.stattools.acf(x, nlags=10, fft=False) | [array n=10] | 1e-10rationaleBoth use the biased 1/n autocovariance convention. | ar1_n120_phi0.6 | ValidatedVALIDATED |
| adf.critical | library | statsmodels 0.14.4statsmodels.tsa.stattools.adfuller(x, regression='c', autolag='AIC') [4] | [array n=3] | 1e-10rationaleMacKinnon (2010) closed-form coefficients evaluated at 1/nobs. | ar1_n120_phi0.6 | ValidatedVALIDATED |
| adf.critical | library | statsmodels 0.14.4statsmodels.tsa.stattools.adfuller(x, regression='c', autolag='AIC') [4] | [array n=3] | 1e-10rationaleMacKinnon (2010) closed-form coefficients evaluated at 1/nobs. | random_walk_n200 | ValidatedVALIDATED |
| adf.p | library | statsmodels 0.14.4statsmodels.tsa.stattools.adfuller(x, regression='c', autolag='AIC') [1] | 0.000020992786 | 0.000001rationaleMacKinnon regression surface p-value; tolerance covers the normal-CDF approximation. | ar1_n120_phi0.6 | ValidatedVALIDATED |
| adf.p | library | statsmodels 0.14.4statsmodels.tsa.stattools.adfuller(x, regression='c', autolag='AIC') [1] | 0.73569227 | 0.000001rationaleMacKinnon regression surface p-value; tolerance covers the normal-CDF approximation. | random_walk_n200 | ValidatedVALIDATED |
| adf.stat | library | statsmodels 0.14.4statsmodels.tsa.stattools.adfuller(x, regression='c', autolag='AIC') | -5.0121899 | 1e-8rationaleLeast-squares t statistic; QR and SVD solvers agree to ~1e-10 on this fixture, 1e-8 gives headroom. | ar1_n120_phi0.6 | ValidatedVALIDATED |
| adf.stat | library | statsmodels 0.14.4statsmodels.tsa.stattools.adfuller(x, regression='c', autolag='AIC') | -1.0471219 | 1e-8rationaleLeast-squares t statistic; QR and SVD solvers agree to ~1e-10 on this fixture, 1e-8 gives headroom. | random_walk_n200 | ValidatedVALIDATED |
| adf.usedlag | library | statsmodels 0.14.4statsmodels.tsa.stattools.adfuller(x, regression='c', autolag='AIC') [2] | 0 | 0rationaleLag selection is discrete and must match exactly (integer comparison). | ar1_n120_phi0.6 | ValidatedVALIDATED |
| adf.usedlag | library | statsmodels 0.14.4statsmodels.tsa.stattools.adfuller(x, regression='c', autolag='AIC') [2] | 0 | 0rationaleLag selection is discrete and must match exactly (integer comparison). | random_walk_n200 | ValidatedVALIDATED |
| bhFdr.qValues | library | statsmodels 0.14.4statsmodels.stats.multitest.multipletests(p, method='fdr_bh')[1] | [array n=12] | 1e-12rationaleSame step-up running-minimum algorithm; exact arithmetic comparison. | pvalues_list | ValidatedVALIDATED |
| difference.values | library | NumPy 2.2.6np.diff(x) | [array n=199] | 1e-12rationaleFirst difference; exact arithmetic apart from representation. | random_walk_n200 | ValidatedVALIDATED |
| harmonic.amplitude1 | library | statsmodels 0.14.4statsmodels.regression.linear_model.OLS(y, [1, t, sin(2*pi*t/7), cos(2*pi*t/7)]).fit() [hypot(params[2], params[3])] | 1.9239070 | 1e-9rationaleAmplitude of the first harmonic, sqrt(a^2 + b^2). | seasonal_stl_n365_p7 | ValidatedVALIDATED |
| harmonic.intercept | library | statsmodels 0.14.4statsmodels.regression.linear_model.OLS(y, [1, t, sin(2*pi*t/7), cos(2*pi*t/7)]).fit() [params[0]] | 0.013045441 | 1e-9rationaleThe Fourier design with period 7 is the harmonic regression specification; the estimator and the covariance come from statsmodels. | seasonal_stl_n365_p7 | ValidatedVALIDATED |
| harmonic.slope | library | statsmodels 0.14.4statsmodels.regression.linear_model.OLS(y, [1, t, sin(2*pi*t/7), cos(2*pi*t/7)]).fit() [params[1]] | 0.19992120 | 1e-9rationaleThe Fourier design with period 7 is the harmonic regression specification; the estimator and the covariance come from statsmodels. | seasonal_stl_n365_p7 | ValidatedVALIDATED |
| harmonic.slopeSe | library | statsmodels 0.14.4statsmodels.stats.sandwich_covariance.cov_hac_simple(model, nlags=L, use_correction=True)[1,1] | 0.00037518128 | 1e-9rationaleBartlett-weighted Newey–West covariance with the small-sample correction. | seasonal_stl_n365_p7 | ValidatedVALIDATED |
| integrity.duplicateStamps | reference-vector | reference-vector: integrity audit specificationcount(intervals == 0) | 1 | 0rationaleThe reference vector implements the audit specification of the workspace directly: the median sampling interval, gaps beyond 1.5 intervals, duplicated stamps, the missing slots implied by a regular grid, the known sentinel codes and runs of identical readings. | ingest_dirty_n180 | ValidatedVALIDATED |
| integrity.gapCount | reference-vector | reference-vector: integrity audit specificationcount(intervals > 1.5 * median interval) | 2 | 0rationaleThe reference vector implements the audit specification of the workspace directly: the median sampling interval, gaps beyond 1.5 intervals, duplicated stamps, the missing slots implied by a regular grid, the known sentinel codes and runs of identical readings. | ingest_dirty_n180 | ValidatedVALIDATED |
| integrity.missingSlots | reference-vector | reference-vector: integrity audit specificationmax(0, round(span/median)+1 - observed) | 1 | 0rationaleThe reference vector implements the audit specification of the workspace directly: the median sampling interval, gaps beyond 1.5 intervals, duplicated stamps, the missing slots implied by a regular grid, the known sentinel codes and runs of identical readings. | ingest_dirty_n180 | ValidatedVALIDATED |
| integrity.nonMonotonicStamps | reference-vector | reference-vector: integrity audit specificationcount(intervals < 0) | 0 | 0rationaleThe reference vector implements the audit specification of the workspace directly: the median sampling interval, gaps beyond 1.5 intervals, duplicated stamps, the missing slots implied by a regular grid, the known sentinel codes and runs of identical readings. | ingest_dirty_n180 | ValidatedVALIDATED |
| integrity.sentinelCount | reference-vector | reference-vector: integrity audit specificationcount(value in known sentinel codes) | 2 | 0rationaleThe reference vector implements the audit specification of the workspace directly: the median sampling interval, gaps beyond 1.5 intervals, duplicated stamps, the missing slots implied by a regular grid, the known sentinel codes and runs of identical readings. | ingest_dirty_n180 | ValidatedVALIDATED |
| integrity.stuckRunCount | reference-vector | reference-vector: integrity audit specificationcount(runs of >= 3 identical consecutive readings) | 1 | 0rationaleThe reference vector implements the audit specification of the workspace directly: the median sampling interval, gaps beyond 1.5 intervals, duplicated stamps, the missing slots implied by a regular grid, the known sentinel codes and runs of identical readings. | ingest_dirty_n180 | ValidatedVALIDATED |
| iqr.iqr | library | NumPy 2.2.6np.quantile(x, .75) - np.quantile(x, .25) | 3.1868929 | 1e-10rationaleDerived from two identical quantile conventions. | quantile_n101 | ValidatedVALIDATED |
| iqr.q1 | library | NumPy 2.2.6np.quantile(x, 0.25) | -2.0560886 | 1e-10rationaleSame quantile convention; tolerance is numerical only. | quantile_n101 | ValidatedVALIDATED |
| iqr.q3 | library | NumPy 2.2.6np.quantile(x, 0.75) | 1.1308043 | 1e-10rationaleSame quantile convention; tolerance is numerical only. | quantile_n101 | ValidatedVALIDATED |
| its.hacLag | library | reference-vector: Newey & West (1994) rulefloor(4 * (n/100) ** (2/9)) | 4 | 0rationaleThe automatic bandwidth is a discrete rule and must match exactly. | intervention_n240_cp120 | ValidatedVALIDATED |
| its.postSlope | library | statsmodels 0.14.4statsmodels.regression.linear_model.OLS(y, [1, t, post*(t-tau), post]).fit() [params[1] + params[2]] | 1.1965055 | 1e-9rationaleThe design matrix is the segmented-regression specification of Berndt & Lavis (1991); the ordinary least-squares solver and the Newey–West covariance come from statsmodels, so only the design is specified here. | intervention_n240_cp120 | ValidatedVALIDATED |
| its.preSlope | library | statsmodels 0.14.4statsmodels.regression.linear_model.OLS(y, [1, t, post*(t-tau), post]).fit() [params[1]] | 0.29992909 | 1e-9rationaleThe design matrix is the segmented-regression specification of Berndt & Lavis (1991); the ordinary least-squares solver and the Newey–West covariance come from statsmodels, so only the design is specified here. | intervention_n240_cp120 | ValidatedVALIDATED |
| its.slopeChange | library | statsmodels 0.14.4statsmodels.regression.linear_model.OLS(y, [1, t, post*(t-tau), post]).fit() [params[2]] | 0.89657639 | 1e-9rationaleThe design matrix is the segmented-regression specification of Berndt & Lavis (1991); the ordinary least-squares solver and the Newey–West covariance come from statsmodels, so only the design is specified here. | intervention_n240_cp120 | ValidatedVALIDATED |
| its.slopeChangeSe | library | statsmodels 0.14.4statsmodels.stats.sandwich_covariance.cov_hac_simple(model, nlags=L, use_correction=True)[2,2] | 0.0041099355 | 1e-9rationaleBartlett-weighted Newey–West covariance with the n/(n-k) small-sample correction; the bandwidth is the automatic rule of Newey & West (1994). | intervention_n240_cp120 | ValidatedVALIDATED |
| kpss.critical | library | statsmodels 0.14.4statsmodels.tsa.stattools.kpss(x, regression='c', nlags='auto') [3] | [array n=4] | 0rationalePublished table values, exact comparison. | ar1_n120_phi0.6 | ValidatedVALIDATED |
| kpss.critical | library | statsmodels 0.14.4statsmodels.tsa.stattools.kpss(x, regression='c', nlags='auto') [3] | [array n=4] | 0rationalePublished table values, exact comparison. | random_walk_n200 | ValidatedVALIDATED |
| kpss.lags | library | statsmodels 0.14.4statsmodels.tsa.stattools.kpss(x, regression='c', nlags='auto') [2] | 5 | 0rationaleAutomatic lag rule is discrete and must match exactly. | ar1_n120_phi0.6 | ValidatedVALIDATED |
| kpss.lags | library | statsmodels 0.14.4statsmodels.tsa.stattools.kpss(x, regression='c', nlags='auto') [2] | 9 | 0rationaleAutomatic lag rule is discrete and must match exactly. | random_walk_n200 | ValidatedVALIDATED |
| kpss.p | library | statsmodels 0.14.4statsmodels.tsa.stattools.kpss(x, regression='c', nlags='auto') [1] | 0.10000000 | 1e-10rationaleBoth interpolate the same Kwiatkowski et al. (1992) table. | ar1_n120_phi0.6 | ValidatedVALIDATED |
| kpss.p | library | statsmodels 0.14.4statsmodels.tsa.stattools.kpss(x, regression='c', nlags='auto') [1] | 0.010000000 | 1e-10rationaleBoth interpolate the same Kwiatkowski et al. (1992) table. | random_walk_n200 | ValidatedVALIDATED |
| kpss.stat | library | statsmodels 0.14.4statsmodels.tsa.stattools.kpss(x, regression='c', nlags='auto') | 0.17907443 | 1e-10rationaleDeterministic sums under the Newey–West estimator; only summation order differs. | ar1_n120_phi0.6 | ValidatedVALIDATED |
| kpss.stat | library | statsmodels 0.14.4statsmodels.tsa.stattools.kpss(x, regression='c', nlags='auto') | 0.88306117 | 1e-10rationaleDeterministic sums under the Newey–West estimator; only summation order differs. | random_walk_n200 | ValidatedVALIDATED |
| kurtosis | library | SciPy 1.16.1scipy.stats.kurtosis(x, fisher=True, bias=True) | -0.25953732 | 1e-10rationaleFisher excess kurtosis with the biased moment estimator. | random_walk_n200 | ValidatedVALIDATED |
| linear.intercept | library | NumPy 2.2.6np.polyfit(t, x, 1) | 9.9015254 | 1e-9rationaleLeast-squares intercept; preset absolute tolerance 1e-9. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| linear.residual | library | NumPy 2.2.6x - np.polyval(np.polyfit(t, x, 1), t) | [array n=150] | 1e-9rationaleResiduals from the same fit; preset absolute tolerance 1e-9. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| linear.slope | library | NumPy 2.2.6np.polyfit(t, x, 1) | 0.49967876 | 1e-9rationaleLeast-squares slope; two solvers, preset absolute tolerance 1e-9. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| mad | library | SciPy 1.16.1scipy.stats.median_abs_deviation(x, scale=1) | 1.4905113 | 1e-10rationaleUnscaled median absolute deviation; convergence factor is applied separately in the modified Z-score. | quantile_n101 | ValidatedVALIDATED |
| mannKendall.exactP | library | SciPy 1.16.1scipy.stats.kendalltau(x, arange(n), method='exact').pvalue | 0.031150794 | 1e-12rationaleBoth enumerate the same permutation null distribution (Mahonian numbers) for n=8 without ties. | small_n8 | ValidatedVALIDATED |
| mannKendall.p | library | pymannkendall 1.4.3pymannkendall.original_test(x) → (s, var_s, z, tau, p) | 0 | 0.000001rationaleTwo-sided normal p-value; tolerance covers the normal-CDF approximation used in the browser. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| mannKendall.S | library | pymannkendall 1.4.3pymannkendall.original_test(x) → (s, var_s, z, tau, p) | 10909 | 0rationaleInteger discordance sum; exact comparison. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| mannKendall.tau | library | pymannkendall 1.4.3pymannkendall.original_test(x) → (s, var_s, z, tau, p) | 0.97619687 | 1e-12rationaleRatio of two exactly matched quantities. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| mannKendall.varS | library | pymannkendall 1.4.3pymannkendall.original_test(x) → (s, var_s, z, tau, p) | 378708.33 | 1e-10rationaleSame tie correction formula; only summation order differs. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| mannKendall.z | library | pymannkendall 1.4.3pymannkendall.original_test(x) → (s, var_s, z, tau, p) | 17.725263 | 1e-10rationaleContinuity-corrected z from matched S and variance. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| mkc3.p | library | none — no independent implementation availableUNVALIDATED | — | 0rationaleDepends on the unvalidated MKC3 variance. | trend_ar1_n150_slope0.5 | UnvalidatedUNVALIDATED |
| mkc3.z | library | none — no independent implementation availableUNVALIDATED | — | 0rationaleNo installed or published reference implementation of MKC3 is available for comparison. | trend_ar1_n150_slope0.5 | UnvalidatedUNVALIDATED |
| mkrd.p | library | none — no independent implementation availableUNVALIDATED | — | 0rationaleDepends on the unvalidated MKRD variance. | trend_ar1_n150_slope0.5 | UnvalidatedUNVALIDATED |
| mkrd.z | library | none — no independent implementation availableUNVALIDATED | — | 0rationaleNo installed or published reference implementation of MKRD is available for comparison. | trend_ar1_n150_slope0.5 | UnvalidatedUNVALIDATED |
| movingAverage.values | reference-vector | reference-vector: centred mean with truncated edgesmean(x[max(0,i-2):min(n,i+3)]) | [array n=150] | 1e-10rationaleThe edge rule is part of the UI contract; the reference vector evaluates that exact rule. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| pacf | library | statsmodels 0.14.4statsmodels.tsa.stattools.pacf(x, nlags=10, method='ywm') | [array n=10] | 1e-10rationaleDurbin–Levinson recursion on the same biased autocorrelations. | ar1_n120_phi0.6 | ValidatedVALIDATED |
| pearson | library | SciPy 1.16.1scipy.stats.pearsonr(x, y) | 0.71641311 | 1e-10rationaleSame definition; only summation order differs. | corr_pair_n200 | ValidatedVALIDATED |
| pearson.p | library | SciPy 1.16.1scipy.stats.pearsonr(x, y).pvalue | 8.6965947e-33 | 0.000001rationalep-value uses a t approximation; the preset tolerance covers the normal-CDF polynomial used by the browser engine. | corr_pair_n200 | ValidatedVALIDATED |
| pelt.breakpoints | library | ruptures 1.1.10ruptures.Pelt(model='l2', min_size=round(sqrt(n)), jump=1).fit(x).predict(pen=2*sigma^2*log(n)) | [array n=3] | 0rationalePELT is exact: the optimal segmentation under this cost and penalty is unique, so the boundaries must match exactly rather than within a tolerance. | ar1_n120_phi0.6 | ValidatedVALIDATED |
| pelt.breakpoints | library | ruptures 1.1.10ruptures.Pelt(model='l2', min_size=round(sqrt(n)), jump=1).fit(x).predict(pen=2*sigma^2*log(n)) | [array n=5] | 0rationalePELT is exact: the optimal segmentation under this cost and penalty is unique, so the boundaries must match exactly rather than within a tolerance. | random_walk_n200 | ValidatedVALIDATED |
| pelt.breakpoints | library | ruptures 1.1.10ruptures.Pelt(model='l2', min_size=round(sqrt(n)), jump=1).fit(x).predict(pen=2*sigma^2*log(n)) | [array n=2] | 0rationalePELT is exact: the optimal segmentation under this cost and penalty is unique, so the boundaries must match exactly rather than within a tolerance. | regime_shift_n180 | ValidatedVALIDATED |
| pelt.penalty | library | ruptures 1.1.102 * (SSE/(n-1)) * log(n) | 13.360717 | 1e-10rationaleThe modified BIC penalty in the additive cost scale; derived from the same residual variance. | ar1_n120_phi0.6 | ValidatedVALIDATED |
| pelt.penalty | library | ruptures 1.1.102 * (SSE/(n-1)) * log(n) | 225.20502 | 1e-10rationaleThe modified BIC penalty in the additive cost scale; derived from the same residual variance. | random_walk_n200 | ValidatedVALIDATED |
| pelt.penalty | library | ruptures 1.1.102 * (SSE/(n-1)) * log(n) | 652.23922 | 1e-10rationaleThe modified BIC penalty in the additive cost scale; derived from the same residual variance. | regime_shift_n180 | ValidatedVALIDATED |
| pelt.sigma2 | library | ruptures 1.1.10SSE/(n-1) | 1.3953776 | 1e-10rationaleUnbiased residual variance of the whole series. | ar1_n120_phi0.6 | ValidatedVALIDATED |
| pelt.sigma2 | library | ruptures 1.1.10SSE/(n-1) | 21.252504 | 1e-10rationaleUnbiased residual variance of the whole series. | random_walk_n200 | ValidatedVALIDATED |
| pelt.sigma2 | library | ruptures 1.1.10SSE/(n-1) | 62.800370 | 1e-10rationaleUnbiased residual variance of the whole series. | regime_shift_n180 | ValidatedVALIDATED |
| qn | reference-vector | reference-vector: Rousseeuw & Croux (1993) with R robustbase 0.99 dn table2.2219 * dn * sorted_pairwise_differences[k-1] | 2.2437656 | 1e-10rationaleThe reference vector implements the published estimator and the dn constants published in R robustbase; no installed Python package provides Qn. | quantile_n101 | ValidatedVALIDATED |
| quantile.q25 | library | NumPy 2.2.6np.quantile(x, 0.25) | -2.0560886 | 1e-10rationaleBoth implementations use linear interpolation; the tolerance only absorbs floating-point summation order. | quantile_n101 | ValidatedVALIDATED |
| quantile.q50 | library | NumPy 2.2.6np.quantile(x, 0.50) | -0.82032015 | 1e-10rationaleBoth implementations use linear interpolation; the tolerance only absorbs floating-point summation order. | quantile_n101 | ValidatedVALIDATED |
| quantile.q75 | library | NumPy 2.2.6np.quantile(x, 0.75) | 1.1308043 | 1e-10rationaleBoth implementations use linear interpolation; the tolerance only absorbs floating-point summation order. | quantile_n101 | ValidatedVALIDATED |
| sd | library | NumPy 2.2.6np.std(x, ddof=1) | 2.1380223 | 1e-10rationaleBoth use the n-1 denominator; only summation order differs. | quantile_n101 | ValidatedVALIDATED |
| skewness | library | SciPy 1.16.1scipy.stats.skew(x, bias=True) | 0.51298598 | 1e-10rationaleBiased population moment, identical formula. | random_walk_n200 | ValidatedVALIDATED |
| smk.p | library | none — no independent implementation availableUNVALIDATED | — | 0rationaleDepends on the unvalidated covariance-adjusted variance. | seasonal_trend_n168_p12 | UnvalidatedUNVALIDATED |
| smk.S | library | pymannkendall 1.4.3pymannkendall.seasonal_test(x, period=12) | 1092 | 0rationaleSum of per-season integer scores; exact comparison. | seasonal_trend_n168_p12 | ValidatedVALIDATED |
| smk.seasonalSenSlope | reference-vector | reference-vector: per-season Sen slope, median across seasons (Hipel 1994)median_g(median_{i<j}(x_jg - x_ig)/(j-i)) | 4.8011203 | 1e-10rationaleThe oracle packages expose a pooled seasonal slope; this reference vector implements the specified median-of-season-medians definition directly. | seasonal_trend_n168_p12 | ValidatedVALIDATED |
| smk.varS | library | none — no independent implementation availableUNVALIDATED | — | 0rationaleThe specification requires the Hirsch–Slack covariance terms; pymannkendall's seasonal test omits them, so it cannot serve as an oracle for this variance. | seasonal_trend_n168_p12 | UnvalidatedUNVALIDATED |
| spc.center | library | NumPy 2.2.6np.mean(x) | 47.127593 | 1e-10rationaleSame mean; summation order tolerance. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| spc.lcl | library | NumPy 2.2.6mean(x) - 3*np.std(x, ddof=1) | -18.065861 | 1e-10rationaleSame sample SD and multiplier. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| spc.ucl | library | NumPy 2.2.6mean(x) + 3*np.std(x, ddof=1) | 112.32105 | 1e-10rationaleSame sample SD and multiplier. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| spearman | library | SciPy 1.16.1scipy.stats.spearmanr(x, y) | 0.70438461 | 1e-10rationaleBoth use average ranks for ties. | corr_pair_n200 | ValidatedVALIDATED |
| spearman.p | library | SciPy 1.16.1scipy.stats.spearmanr(x, y).pvalue | 2.6930286e-31 | 0.000001rationalet approximation with the same tolerance rationale as Pearson. | corr_pair_n200 | ValidatedVALIDATED |
| stl.residual | library | statsmodels 0.14.4statsmodels.tsa.seasonal.STL(x, period=7, seasonal=7, robust=True).fit() [resid] | [array n=365] | 0.000001rationaleIndependent STL implementations differ only in floating-point summation order; the preset absolute tolerance of 1e-6 is applied to values of order 10 and is not loosened after the run. | seasonal_stl_n365_p7 | ValidatedVALIDATED |
| stl.seasonal | library | statsmodels 0.14.4statsmodels.tsa.seasonal.STL(x, period=7, seasonal=7, robust=True).fit() [seasonal] | [array n=365] | 0.000001rationaleIndependent STL implementations differ only in floating-point summation order; the preset absolute tolerance of 1e-6 is applied to values of order 10 and is not loosened after the run. | seasonal_stl_n365_p7 | ValidatedVALIDATED |
| stl.trend | library | statsmodels 0.14.4statsmodels.tsa.seasonal.STL(x, period=7, seasonal=7, robust=True).fit() [trend] | [array n=365] | 0.000001rationaleIndependent STL implementations differ only in floating-point summation order; the preset absolute tolerance of 1e-6 is applied to values of order 10 and is not loosened after the run. | seasonal_stl_n365_p7 | ValidatedVALIDATED |
| stl.weights | library | statsmodels 0.14.4statsmodels.tsa.seasonal.STL(x, period=7, seasonal=7, robust=True).fit() [weights] | [array n=365] | 0.000001rationaleIndependent STL implementations differ only in floating-point summation order; the preset absolute tolerance of 1e-6 is applied to values of order 10 and is not loosened after the run. | seasonal_stl_n365_p7 | ValidatedVALIDATED |
| tfpw.p | library | pymannkendall 1.4.3pymannkendall.trend_free_pre_whitening_modification_test(x) | 0 | 0.000001rationaleTwo-sided normal p-value; normal-CDF approximation tolerance. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| tfpw.S | library | pymannkendall 1.4.3pymannkendall.trend_free_pre_whitening_modification_test(x) | 10776 | 0rationaleInteger score on the whitened series; exact comparison. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| tfpw.varS | library | pymannkendall 1.4.3pymannkendall.trend_free_pre_whitening_modification_test(x) | 371208.67 | 1e-10rationaleTie-corrected variance on the same whitened series. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| tfpw.z | library | pymannkendall 1.4.3pymannkendall.trend_free_pre_whitening_modification_test(x) | 17.685129 | 1e-10rationaleSame continuity-corrected z. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| theilSen.hiSlope | library | SciPy 1.16.1scipy.stats.theilslopes(x, arange(n), alpha=0.95) | 0.50320355 | 1e-10rationaleSen (1968) order-statistic interval; identical rank arithmetic. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| theilSen.intercept | library | SciPy 1.16.1scipy.stats.theilslopes(x, arange(n), alpha=0.95) | 10.005866 | 1e-10rationalemedian(y) - slope * median(x), matching scipy's separate method. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| theilSen.loSlope | library | SciPy 1.16.1scipy.stats.theilslopes(x, arange(n), alpha=0.95) | 0.49512791 | 1e-10rationaleSen (1968) order-statistic interval; identical rank arithmetic. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| theilSen.slope | library | SciPy 1.16.1scipy.stats.theilslopes(x, arange(n), alpha=0.95) | 0.49903986 | 1e-10rationaleMedian of all pairwise slopes; exact same pair set. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| variance | library | NumPy 2.2.6np.var(x, ddof=1) | 4.5711394 | 1e-10rationaleBoth use the n-1 denominator; only summation order differs. | quantile_n101 | ValidatedVALIDATED |
| yueWang.correctionFactor | library | pymannkendall 1.4.3yue_wang_modification_test(x).var_s / original_test(x).var_s | 0.17145758 | 1e-12rationaleRatio of two variances that must agree; only floating-point summation order differs. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| yueWang.nEffective | library | pymannkendall 1.4.3n / (corrected var_s / uncorrected var_s) | 874.85195 | 1e-8rationaleDerived from the two validated variances; the preset absolute tolerance absorbs summation order. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| yueWang.p | library | pymannkendall 1.4.3pymannkendall.yue_wang_modification_test(x) | 0 | 0.000001rationaleTwo-sided normal p-value; normal-CDF approximation tolerance. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| yueWang.varS | library | pymannkendall 1.4.3pymannkendall.yue_wang_modification_test(x) | 64932.415 | 1e-8rationaleVariance is of order 6.5e4; the preset absolute tolerance 1e-8 corresponds to a relative error below 2e-13 and only absorbs floating-point summation order. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
| yueWang.z | library | pymannkendall 1.4.3pymannkendall.yue_wang_modification_test(x) | 42.806956 | 1e-10rationaleSame corrected z formula. | trend_ar1_n150_slope0.5 | ValidatedVALIDATED |
统计验证:如何检查工具的正确性
独立 oracle 测试不是一张“测试通过”的截图,而是与工具未参与编写的实现进行可复现对照,输入可由任何人重建。
使用独立于工具的 oracle
Mann-Kendall 参考实现必须来自外部:pymannkendall、R Kendall 或已发表向量。让引擎与自己比较不能证明任何事情。
比较前先固定容差
看到差异之后再选容差,是合理化而不是验证。这里每一行都在门禁运行前公开容差及其理由。
由种子重建 fixture
只有当输入确定时,统计检验才可复现。每个 fixture 保存种子、生成器与参数,构建过程从 spec 重建它。
相关方法说明
什么算 oracle
ADF、KPSS、STL、ACF、PACF 使用 statsmodels;Theil–Sen、相关、偏度与峰度使用 SciPy;Mann–Kendall 家族使用 pymannkendall;分位数与最小二乘使用 NumPy。没有可用安装实现时,使用已发表参考向量并明确标注。
晋升规则
只有当 oracle 独立、容差在运行前写入、fixture 可由种子与参数重建、门禁通过、参考库版本一致时,一行才成为 VALIDATED。失败行阻断构建。
哪些未验证
MKRD、MKC3 与协方差校正的季节 MK p 值没有可用独立 oracle。它们已实现,在界面中标记 UNVALIDATED,且只要存在已验证替代,就绝不承担头条结论。
自己重跑
克隆仓库并运行 npm run verify:gate。命令会从 spec 重建 fixture,运行 Python oracle(statsmodels 0.14.4、SciPy 1.16.1、pymannkendall 1.4.3),将 TypeScript 引擎与 reference_vectors.json 对照,并重写 VALIDATION.md 与本页读取的 JSON。
哪些未验证,以及为什么
这些统计量已实现并展示,但没有可用的独立实现。界面永久标记它们;只要存在已验证替代,它们绝不承担头条结论。
Depends on the unvalidated MKC3 variance.
Shown in the UI with a permanent UNVALIDATED badge.
No installed or published reference implementation of MKC3 is available for comparison.
Shown in the UI with a permanent UNVALIDATED badge.
Depends on the unvalidated MKRD variance.
Shown in the UI with a permanent UNVALIDATED badge.
No installed or published reference implementation of MKRD is available for comparison.
Shown in the UI with a permanent UNVALIDATED badge.
Depends on the unvalidated covariance-adjusted variance.
Shown in the UI with a permanent UNVALIDATED badge.
The specification requires the Hirsch–Slack covariance terms; pymannkendall's seasonal test omits them, so it cannot serve as an oracle for this variance.
Shown in the UI with a permanent UNVALIDATED badge.
重跑整个矩阵
fixture 生成器、Python oracle 与门禁都在仓库中。无私有服务,无手工步骤。
# Python oracle: statsmodels 0.14.4, scipy 1.16.1, pymannkendall 1.4.3 npm run verify:fixtures # deterministic fixtures from specs.json npm run verify:oracle # reference_vectors.json npm run verify:gate # compare + rewrite VALIDATION.md
参考库版本:statsmodels 0.14.4; scipy 1.16.1; numpy 2.2.6; pymannkendall 1.4.3; ruptures v1.1.10
本地安装的第三方实现。
独立求值的已发表估计量。
记录的测量值,仅在无实现时使用。