Post hoc inference via multiple testing
Reason this release was yanked:
wrong download link + github repo link
Project description
sanssouci.python
General presentation
Post hoc inference via multiple testing
The goal of this projet is to port the R package sansSouci to python.
Authors: Laurent Risser and Pierre Neuvial.
Permutation-based confidence envelopes
A typical output for fMRI data (Localizer data set, left vs right click) is shown below:
The left plot displays an upper confidence envelope on the False Discovery Proportion among the most significant voxels. The right plot displays a lower confidence envelope on the number of True Postives among the most significant voxels. See the Script to reproduce this plot.
Test the package on synthetic data
Here is a simple code you can use to test and get familiar with the sanssouci package. Other examples are given in the examples directory.
import sanssouci as sa
import numpy as np
#1) generate phantom data
p = 130
n = 45
X=np.random.randn(n,p) #NOTE: no signal!! we expect trivial bounds
categ=np.random.binomial(1, 0.4, size=n)
#2) test the algorithm
B = 100
pval0=sa.get_perm_p(X, categ, B=B , row_test_fun=sa.row_welch_tests)
K=p
piv_stat=sa.get_pivotal_stats(pval0, K=K)
#3) Compute Bounds
alpha=0.1
lambda_quant=np.quantile(piv_stat, alpha)
thr=sa.t_linear(lambda_quant, np.arange(1,p+1), p)
swt=sa.row_welch_tests(X, categ)
p_values=swt['p_value'][:]
pvals=p_values[:10]
bound = sa.max_fp(pvals, thr)
print(bound)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for sanssouci-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2ed38fb01dfe2eb8bbfd9eec44841c573571e07f8ec68e5c69b10268cb8e4f0 |
|
MD5 | 039c94372aaff708cac2e4ef9dc17546 |
|
BLAKE2b-256 | 33481aa1a11ca0bef5da701b35d11dd0fee0c9b8f607a40302d2c7a25736e9c3 |