Skip to content

Commit 48d17b3

Browse files
Merge pull request #10 from bystrogenomics/feature/better_documentation
One more
2 parents 52187c3 + 70334d6 commit 48d17b3

File tree

8 files changed

+260
-8
lines changed

8 files changed

+260
-8
lines changed

covtest/methods/hypothesis_identity.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -484,12 +484,6 @@ def srivastava2011_single_sample(X, Sigma="identity"):
484484
- 'p_value' : float
485485
Two-sided p-value.
486486
487-
References
488-
----------
489-
.. [1] Srivastava, M. S., & Yanagihara, H. (2011). "Testing
490-
the equality of several covariance matrices with fewer
491-
observations than the dimension." Journal of
492-
Multivariate Analysis.
493487
"""
494488
X = validate_data_matrix(X)
495489
p = X.shape[1]

docs/api/covtest.datasets.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. _covtest-datasets:
2+
3+
Datasets
4+
========
5+
6+
This page documents the dataset loading utilities implemented in :mod:`covtest.datasets`.
7+
These functions allow loading standard datasets for testing covariance methods.
8+
9+
.. currentmodule:: covtest.datasets.loader
10+
11+
.. automodule:: covtest.datasets.loader
12+
:no-members:
13+
14+
.. autosummary::
15+
:toctree: generated/
16+
:template: function.rst
17+
18+
load_mnist
19+
load_tcga
20+
load_iris

docs/api/covtest.diagnostics.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
.. _covtest-diagnostics:
2+
3+
Diagnostics
4+
===========
5+
6+
This page documents the diagnostic utilities implemented in :mod:`covtest.diagnostics`.
7+
These include tests for multivariate normality and tools for evaluating p-value distributions.
8+
9+
Assumptions and normality tests
10+
-------------------------------
11+
12+
.. currentmodule:: covtest.diagnostics.assumptions
13+
14+
.. automodule:: covtest.diagnostics.assumptions
15+
:no-members:
16+
17+
.. autosummary::
18+
:toctree: generated/
19+
:template: function.rst
20+
21+
eigen_spectrum
22+
mardia_tests
23+
shapiro_francia_w
24+
royston_test
25+
hz_test
26+
condition_and_rank
27+
28+
P-value evaluation
29+
------------------
30+
31+
.. currentmodule:: covtest.diagnostics.evaluate_pvalues
32+
33+
.. automodule:: covtest.diagnostics.evaluate_pvalues
34+
:no-members:
35+
36+
.. autosummary::
37+
:toctree: generated/
38+
:template: function.rst
39+
40+
analyze_pvalues

docs/api/covtest.plotting.rst

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
.. _covtest-plotting:
2+
3+
Plotting utilities
4+
==================
5+
6+
This page documents the plotting utilities implemented in :mod:`covtest.plotting`.
7+
These include functions for visualizing power curves, p-value distributions,
8+
and covariance matrix structures.
9+
10+
Power analysis plots
11+
--------------------
12+
13+
.. currentmodule:: covtest.plotting.alternative
14+
15+
.. automodule:: covtest.plotting.alternative
16+
:no-members:
17+
18+
.. autosummary::
19+
:toctree: generated/
20+
:template: function.rst
21+
22+
plot_power_curve
23+
plot_power_heatmap
24+
plot_mean_pvalue
25+
plot_pvalue_distributions
26+
plot_power_curves_multi_alpha
27+
28+
Null distribution diagnostics
29+
-----------------------------
30+
31+
.. currentmodule:: covtest.plotting.null
32+
33+
.. automodule:: covtest.plotting.null
34+
:no-members:
35+
36+
.. autosummary::
37+
:toctree: generated/
38+
:template: function.rst
39+
40+
plot_pval_histogram
41+
plot_pval_qq
42+
plot_pval_ecdf
43+
plot_pval_cumdev
44+
plot_pval_obs_vs_exp
45+
plot_pval_survival
46+
plot_pval_running_mean
47+
plot_pval_zdist
48+
plot_pval_calibration
49+
qq_plot_log_p
50+
pvalue_histogram
51+
plot_pval_diagnostics
52+
plot_pvalue_diagnostics_grid
53+
54+
Structure visualization
55+
-----------------------
56+
57+
.. currentmodule:: covtest.plotting.structure
58+
59+
.. automodule:: covtest.plotting.structure
60+
:no-members:
61+
62+
.. autosummary::
63+
:toctree: generated/
64+
:template: function.rst
65+
66+
plot_eigen_scree
67+
plot_matrix_structure

docs/api/covtest.simulation.rst

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
.. _covtest-simulation:
2+
3+
Simulation utilities
4+
====================
5+
6+
This page documents the simulation utilities implemented in :mod:`covtest.simulation`.
7+
These include functions for generating covariance matrices with specific structures
8+
and generating multivariate data from various distributions.
9+
10+
Covariance matrix generation
11+
----------------------------
12+
13+
.. currentmodule:: covtest.simulation.generate_covariances
14+
15+
.. automodule:: covtest.simulation.generate_covariances
16+
:no-members:
17+
18+
.. autosummary::
19+
:toctree: generated/
20+
:template: function.rst
21+
22+
sample_goe
23+
sample_cov_uniform_correlation
24+
generate_spectral_cov
25+
generate_toeplitz_cov
26+
generate_block_diagonal_cov
27+
generate_low_rank_cov
28+
generate_sparse_precision_cov
29+
generate_marchenko_pastur
30+
generate_spiked_covariance
31+
32+
Data generation
33+
---------------
34+
35+
.. currentmodule:: covtest.simulation.generate_data
36+
37+
.. automodule:: covtest.simulation.generate_data
38+
:no-members:
39+
40+
.. autosummary::
41+
:toctree: generated/
42+
:template: function.rst
43+
44+
generate_heavy_tailed_samples
45+
generate_heavy_tailed_alternative

docs/api/covtest.testing.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.. _covtest-testing:
2+
3+
Testing utilities
4+
=================
5+
6+
This page documents the testing and benchmarking utilities implemented
7+
in :mod:`covtest.testing`.
8+
9+
Benchmarking
10+
------------
11+
12+
.. currentmodule:: covtest.testing.timing
13+
14+
.. automodule:: covtest.testing.timing
15+
:no-members:
16+
17+
.. autosummary::
18+
:toctree: generated/
19+
:template: function.rst
20+
21+
benchmark_computation_dimension
22+
benchmark_computation_sample_size
23+
plot_computation_dimension
24+
plot_computation_sample_size

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# Project information
1515
# -------------------------------------------------------------------
1616
project = "scikit-covtest"
17-
author = "Your Name"
17+
author = "Austin Talbot"
1818

1919
# Try to get the version from the package if available
2020
try:

docs/index.rst

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,78 @@
11
scikit-covtest documentation
22
============================
33

4+
scikit-covtest is a Python package for high dimensional covariance matrix
5+
testing, with a focus on both classical and high-dimensional tests
6+
7+
It provides statistically principled tests for:
8+
9+
- Identity and sphericity of covariance matrices
10+
- Proportionality between two covariance matrices
11+
- Two-sample equality testing in high dimensions
12+
- Multiple testing control for large test families
13+
14+
The library is designed for:
15+
16+
- Statistical genomics and gene expression analysis
17+
- High dimensional machine learning diagnostics
18+
- Simulation driven theoretical validation
19+
- Large scale hypothesis testing pipelines
20+
21+
Installation
22+
------------
23+
24+
Install from PyPI:
25+
26+
.. code-block:: bash
27+
28+
pip install scikit-covtest
29+
30+
Or install from source:
31+
32+
.. code-block:: bash
33+
34+
git clone https://github.com/bystrogenomics/scikit-covtest.git
35+
cd scikit-covtest
36+
pip install .
37+
38+
Quickstart
39+
----------
40+
41+
Minimal example using a covariance identity test:
42+
43+
.. code-block:: python
44+
45+
import numpy as np
46+
from covtest.methods import hypothesis_identity as hi
47+
48+
rng = np.random.default_rng(0)
49+
X = rng.normal(size=(200, 50))
50+
51+
result = hi.ahmad2015_identity(X)
52+
print("Statistic: ", result['stat'])
53+
print("p-value: ", result['p_value'])
54+
55+
User guide
56+
----------
57+
458
.. toctree::
559
:maxdepth: 2
660
:caption: User guide
761

862
user_guide/multiple_testing
963

64+
API reference
65+
-------------
66+
1067
.. toctree::
1168
:maxdepth: 1
1269
:caption: API reference
1370

14-
api/covtest.multiplicity
71+
api/covtest.datasets
72+
api/covtest.diagnostics
1573
api/covtest.methods
74+
api/covtest.multiplicity
75+
api/covtest.plotting
76+
api/covtest.simulation
77+
api/covtest.testing
1678

0 commit comments

Comments
 (0)