Migrating from SHT for R#
pySHT is an independently validated successor to SHT, not a line-by-line
translation. The compatibility baseline is SHT 0.1.9 at commit
4e29cda1257f86dd0237d37329af358b54d04f2b. A primary paper and the stated
hypotheses take precedence whenever the legacy implementation disagrees with
the mathematics.
The pinned R namespace contains 56 exports: 54 statistical routine identities
and two dynamic adapters. The public pySHT API has 51 canonical functions
covering 52 of those 54 identities: mvar1.1998AS and mvar1.LRT share one
algebraically identical implementation, while mean2.2014CLX and
cov1.2012Fisher are validation-blocked and have no public Python mapping. The
adapters are unnecessary in Python.
Complete statistical crosswalk#
[1] Tests for univariate mean#
SHT 0.1.9 |
pySHT |
|---|---|
|
|
|
|
|
|
[2] Tests for multivariate mean#
SHT 0.1.9 |
pySHT |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Validation-blocked; no public pySHT callable |
|
|
|
|
|
|
|
|
|
|
[3] Tests for variance#
SHT 0.1.9 |
pySHT |
|---|---|
|
|
|
|
|
|
|
|
|
|
[4] Tests for covariance#
SHT 0.1.9 |
pySHT |
|---|---|
|
Withheld: corrected private implementation has not passed reproducible release gates |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The exported-but-pkgdown-hidden cov2.mxPBF is included because it is in the
0.1.9 namespace. The source-only cov1.mxPBF is excluded: it is marked
@noRd, absent from NAMESPACE, and is not one of the 54 public tests.
[5] Simultaneous tests for mean and variance#
SHT 0.1.9 |
pySHT |
Note |
|---|---|---|
|
|
Arnold–Shavelle form |
|
|
Same algebra as the preceding R routine |
|
|
Lower likelihood-ratio tail corrected |
|
|
Fisher combination |
|
|
Upper rejection tail corrected |
|
|
Stable exact calculation |
|
|
Asymptotic LRT |
[6] Simultaneous tests for mean and covariance#
SHT 0.1.9 |
pySHT |
|---|---|
|
|
|
|
|
|
[7] Tests for equality of distributions#
SHT 0.1.9 |
pySHT |
|---|---|
|
|
Only exact and corrected Monte Carlo permutation calibration are available. The invalid legacy asymptotic branch is outside the compatibility target.
[8] Goodness-of-fit: normal distribution#
SHT 0.1.9 |
pySHT |
|---|---|
|
|
|
|
|
|
|
|
|
|
[9] Goodness-of-fit: uniform distribution#
SHT 0.1.9 |
pySHT |
|---|---|
|
|
|
|
[10] Tests on special domains#
SHT 0.1.9 |
pySHT |
|---|---|
|
|
The two adapter exports#
usek1d and useknd accept an R function and a list of samples. Python users
call an ordinary callable directly and pass multi-group samples positionally,
so pySHT deliberately provides no adapter aliases:
from pysht.variance import brown_forsythe
result = brown_forsythe(group_a, group_b, group_c)
Argument translation#
R convention |
Python convention |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
positional groups: |
|
descriptive lowercase options, |
ambient R random state |
|
|
|
|
no counterpart; the current runtime is NumPy/SciPy only |
matrices |
arrays |
Short R option initials such as "L" and "T" are not accepted. Use the
documented lowercase word, such as "bai-saranadasa", "hotelling",
"clime", or "monte-carlo". Public controls are keyword-only when a
positional value would be ambiguous.
Result translation#
R |
pySHT field |
|---|---|
|
|
|
|
|
|
|
|
|
|
named parameters |
|
|
|
print(result) gives an htest-style summary, but the Python object is
immutable. Resampling results retain counts, exactness, Monte Carlo standard
error, and a binomial tail-probability interval.
The two LYL functions return BayesFactorTestResult, not an object pretending
to be a frequentist htest. They expose the maximum and component log Bayes
factors and intentionally have no p-value. pySHT never exponentiates the
maximum internally or supplies an automatic evidence threshold. Their default
gamma is derived from alpha=2.01, sample size, and dimension. Unlike the
legacy covariance kernel’s implicit centering, the Python covariance function
uses the primary paper’s known-zero-mean, no-intercept model.
Deliberate correctness differences#
The corrected Fisher covariance implementation whitens by the supplied null covariance, but remains private until reproducible null and power gates pass; the legacy code calculated that transform and then ignored it.
Li–Chen uses literal scale-equivariant U-statistics.
Wu–Li equality tests account for both directions instead of applying a one-sided maximum to a two-sided hypothesis.
Pearson–Neyman and Muirhead use the rejection tails implied by their likelihood-ratio statistics.
Cao–Park–He evaluates each group in both variance-estimator branches rather than reusing a stale loop index.
Adjusted and robust Jarque–Bera default calls are defined, and finite-sample Monte Carlo calibration reports its simulation uncertainty.
Random projections and subspaces are drawn once and held fixed across the observed and permuted statistics.
Zhang–Xu–Chen and all Bayes-factor kernels use log-domain arithmetic where direct exponentiation would underflow or overflow.
Biswas–Ghosh uses floating-point tie handling, exact enumeration when feasible, stable distance normalization, and no legacy asymptotic branch.
See the method-name glossary for expanded surnames and the validation ledgers for the evidence behind these departures.