Skip to content

ENH: add inference for variance without normality assumptions - #8293

Open
josef-pkt wants to merge 1 commit into
statsmodels:mainfrom
josef-pkt:variance_moments
Open

josef-pkt wants to merge 1 commit into
statsmodels:mainfrom
josef-pkt:variance_moments

Conversation

@josef-pkt

Copy link
Copy Markdown
Member

first version, mainly bonett for variance confidence interval using kurtosis
written while reading references in 8261

issues:
#8261 inference for variance
#8286 kurtosis and jarque-bera
#8289 inference for correlation (just references without details)

current plan

I just want to get the basic versions in mainly bonett, plain kurtosi-adjusted and traditional inference under normality assumptions.
There are too many options for additional variations of methods, e.g. for kurtosis small sample and bias corrections, and there is no obvious winner for those.

cases:

  • one-sample
  • variances_2indep
    • ratio: ftest and exp (as in bonnet)
    • diff not a large literature, confint based on MOVER, but doesn't easily translate to hypothesis test (would need inversion of confint)
    • tost: not implemented yet, a few references are available
  • power: just the basics, mainly based on NCSS/PASS (but that only includes methods based on normality assumption of data)

I would like to get some "score" versions (variance of test statistic base on null assumption), but there isn't much literature on it, confint requires derivation and needs to be verified by Monte Carlo.
Current versions and almost all the literature uses estimated variance in variance of test statistic, i.e. is wald-type.

However, exp transformation of variance ratio removes the variance from the variance of the test statistic. variance only enters through the kurtosis estimate.

@josef-pkt

Copy link
Copy Markdown
Member Author

no unit tests yet, I might have some test cases in notebooks.

I would like to merge the basic version with experimental api for 0.14, without restrictions on backwards compatibility in future changes except for basic methods like "bonett".

@josef-pkt josef-pkt modified the milestones: 0.14, 0.15 Jul 25, 2025
@josef-pkt

Copy link
Copy Markdown
Member Author

I didn't remember this.

Getting robust variance inference is an important topic . There should be more also for the multivariate case (testing covariance)

verifying this PR might have to rely on Monte Carlo simulations. I don't remember seeing this or looking for it in other statistical packages (that I have access to)

(g2 + 3 - 1) * var_y**2

based on
Yuan, Bentler and Zhang 2005 p. 248

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs full reference

def kurtosis(y, method=None, center="mean", return_results=False):
"""Estimators for excess kurtosis

g2, G2, b2 from Joanes and Gill 1998

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incomplete docstring
full reference missing

@josef-pkt josef-pkt mentioned this pull request Aug 18, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant