Skip to content

ENH: add covariance structure hypothesis tests - #6693

Merged
josef-pkt merged 2 commits into
statsmodels:masterfrom
josef-pkt:cov_structure_inference
May 8, 2020
Merged

josef-pkt merged 2 commits into
statsmodels:masterfrom
josef-pkt:cov_structure_inference

Conversation

@josef-pkt

Copy link
Copy Markdown
Member

test for spherical, diagonal, ... cov structures
based on Stata docs

based on script from #2765 (comment)

@coveralls

coveralls commented May 7, 2020 •

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.01%) to 87.782% when pulling dc81cfe on josef-pkt:cov_structure_inference into 1d5576c on statsmodels:master.

@josef-pkt

Copy link
Copy Markdown
Member Author

Did I write somewhere the correlation version of these functions?
e.g. independence, sphericity based on corr?

I think I did but don't remember.

#3842 has KMO, but that belongs to statsmodels.multivariate as diagnostic measure,
in psych in R and in Stata as fa and pca post-estimation.

compound symmetry is missing in this PR of the structures that Stata has.

@josef-pkt josef-pkt added this to the 0.12 milestone May 7, 2020
@josef-pkt
josef-pkt force-pushed the cov_structure_inference branch 2 times, most recently from 54e06b6 to cc40c61 Compare May 7, 2020 21:59
@josef-pkt
josef-pkt force-pushed the cov_structure_inference branch from cc40c61 to 9fb00bb Compare May 7, 2020 22:08
@josef-pkt

josef-pkt commented May 7, 2020 •

Copy link
Copy Markdown
Member Author

all green (except lint in master), almost full test coverage
Box-M test is missing a branch in a condition
if c2 > c1**2
looks the same as in Stata docs, but I don't know what triggers that case. I don't manage to find a case in a quick example.

related: there is currently no check that nobs is large enough to avoid zero or negative analogues of degrees of freedom.

notation for oneway
m : number of samples
k : number of variables or dimension of mv mean
we need at least (nobs - m) > 0 where nobs = sum(nobs_list)
I get a negative statistic_f if I set nobs_list to small number

Rencher Christensen p. 267
It is clear that we must have every (n_j - 1) > p (edited) p is dim of mv rv

@lgtm-com

lgtm-com Bot commented May 8, 2020

Copy link
Copy Markdown

This pull request introduces 1 alert when merging 557ccc0 into 1d5576c - view on LGTM.com

new alerts:

  • 1 for Unreachable code

@josef-pkt
josef-pkt force-pushed the cov_structure_inference branch from 557ccc0 to dc81cfe Compare May 8, 2020 17:18
@josef-pkt

Copy link
Copy Markdown
Member Author

fixed last commit by amending

still not much input checking

merge when green

@josef-pkt

Copy link
Copy Markdown
Member Author

all green, AFAICS, except for linting in master

merging

@josef-pkt
josef-pkt merged commit eda1c08 into statsmodels:master May 8, 2020
@josef-pkt josef-pkt mentioned this pull request Aug 24, 2020
@josef-pkt
josef-pkt deleted the cov_structure_inference branch February 21, 2021 13:49
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.

2 participants