Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rglasso #43

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
49 changes: 49 additions & 0 deletions selection.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Metadata-Version: 2.1
Name: selection
Version: 0+untagged.2485.g1019ee0.dirty
Summary: Testing a fixed value of lambda
Home-page: http://github.org/jonathan.taylor/fixed_lambda
Author: fixed_lambda developers
Author-email:
Maintainer: Jonathan Taylor
Maintainer-email:
License: BSD license
Description: # The selection project

This project contains software for selective inference, with
emphasis on selective inference in regression.

Some key references:

* `A significance test for the lasso`: http://arxiv.org/abs/1301.7161
* `Tests in adaptive regression via the Kac-Rice formula`: http://arxiv.org/abs/1308.3020
* `Post-selection adaptive inference for Least Angle Regression and the Lasso`: http://arxiv.org/abs/1401.3889
* `Exact post-selection inference with the lasso`: http://arxiv.org/abs/1311.6238
* `Exact Post Model Selection Inference for Marginal Screening`: http://arxiv.org/abs/1402.5596

Install
-------


```
git submodule init # travis_tools and C-software
git submodule update
pip install -r requirements.txt
python setup.py install
```

Platform: OS Independent
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Scientific/Engineering
Requires: numpy (>=1.7.1)
Requires: scipy (>=0.9)
Requires: mpmath (>=0.18)
Requires: pyinter
Provides: fixed_lambda
Provides-Extra: test
Provides-Extra: doc
186 changes: 186 additions & 0 deletions selection.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
LICENSE
MANIFEST.in
README.md
TODO
cythexts.py
setup.cfg
setup.py
setup_helpers.py
setup_helpers.pyc
versioneer.py
C-software/src/debias.h
C-software/src/matrixcomps.h
C-software/src/quadratic_program_wide.c
C-software/src/randomized_lasso.h
C-software/src/selective_mle.c
C-software/src/selective_mle.h
doc/Makefile
doc/examples/compute_coverages.rst
doc/examples/conditional_sampling.py
doc/examples/hiv_approx_ci.py
doc/examples/power_comparison.py
doc/notebooks/UMPU.ipynb
doc/notebooks/covtest.ipynb
doc/notebooks/isotonic.ipynb
doc/notebooks/lasso.ipynb
doc/notebooks/pca_rank1.ipynb
doc/notebooks/quadratic_decisions.ipynb
doc/notebooks/reduced_covtest.ipynb
doc/notebooks/screening.ipynb
doc/notebooks/selection_objects.ipynb
doc/notebooks/spacings.ipynb
doc/source/conf.py
doc/source/docattribute.rst
doc/source/documentation.rst
doc/source/download.rst
doc/source/index.rst
doc/source/links_names.txt
doc/source/spacings.rst
doc/source/_static/logo.png
doc/source/_static/selection.css
doc/source/_templates/layout.html
doc/source/spacings_files/spacings_23_0.png
doc/source/spacings_files/spacings_25_0.png
doc/source/spacings_files/spacings_27_0.png
doc/source/spacings_files/spacings_29_0.png
doc/source/spacings_files/spacings_31_0.png
doc/source/spacings_files/spacings_3_0.png
doc/source/spacings_files/spacings_4_0.png
doc/source/spacings_files/spacings_5_0.png
doc/source/spacings_files/spacings_6_0.png
doc/source/spacings_files/spacings_7_0.png
doc/source/spacings_files/spacings_9_0.png
doc/source/sphinxext/math_dollar.py
selection/__init__.py
selection/_version.py
selection/api.py
selection/base.py
selection/glm.py
selection/info.py
selection.egg-info/PKG-INFO
selection.egg-info/SOURCES.txt
selection.egg-info/dependency_links.txt
selection.egg-info/not-zip-safe
selection.egg-info/requires.txt
selection.egg-info/top_level.txt
selection/algorithms/__init__.py
selection/algorithms/api.py
selection/algorithms/change_point.py
selection/algorithms/covtest.py
selection/algorithms/cv.py
selection/algorithms/cv_glmnet.py
selection/algorithms/debiased_lasso.py
selection/algorithms/debiased_lasso_utils.pyx
selection/algorithms/forward_step.py
selection/algorithms/lasso.py
selection/algorithms/pca.py
selection/algorithms/screening.py
selection/algorithms/softmax.py
selection/algorithms/sqrt_lasso.py
selection/algorithms/stopping_rules.py
selection/algorithms/tests/__init__.py
selection/algorithms/tests/test_IC.py
selection/algorithms/tests/test_ROSI.py
selection/algorithms/tests/test_change_point.py
selection/algorithms/tests/test_compareR.py
selection/algorithms/tests/test_covtest.py
selection/algorithms/tests/test_data_carving.py
selection/algorithms/tests/test_debiased_lasso.py
selection/algorithms/tests/test_forward_step.py
selection/algorithms/tests/test_lasso.py
selection/algorithms/tests/test_screening.py
selection/algorithms/tests/test_softmax.py
selection/algorithms/tests/test_sqrt_lasso.py
selection/constraints/__init__.py
selection/constraints/affine.py
selection/constraints/api.py
selection/constraints/base.py
selection/constraints/estimation.py
selection/constraints/intervals.py
selection/constraints/quadratic.py
selection/constraints/quasi_affine.py
selection/constraints/tests/__init__.py
selection/constraints/tests/test_affine.py
selection/constraints/tests/test_estimation.py
selection/constraints/tests/test_quadratic_tests.py
selection/constraints/tests/test_quasi.py
selection/constraints/tests/test_unknown_sigma.py
selection/distributions/__init__.py
selection/distributions/api.py
selection/distributions/chain.py
selection/distributions/chisq.py
selection/distributions/discrete_family.py
selection/distributions/discrete_multiparameter.py
selection/distributions/intervals.py
selection/distributions/pvalue.py
selection/distributions/tests/__init__.py
selection/distributions/tests/test_chains.py
selection/distributions/tests/test_discreteExFam.py
selection/distributions/tests/test_multiparameter.py
selection/randomized/__init__.py
selection/randomized/api.py
selection/randomized/cv_view.py
selection/randomized/gen_lasso.py
selection/randomized/gen_lasso_utils.py
selection/randomized/lasso.py
selection/randomized/modelQ.py
selection/randomized/qp.py
selection/randomized/query.py
selection/randomized/randomization.py
selection/randomized/screening.py
selection/randomized/selective_MLE_utils.pyx
selection/randomized/slope.py
selection/randomized/tests/__init__.py
selection/randomized/tests/test_BH.py
selection/randomized/tests/test_genlasso.py
selection/randomized/tests/test_lasso.py
selection/randomized/tests/test_marginal_screening.py
selection/randomized/tests/test_modelQ.py
selection/randomized/tests/test_multiple_queries.py
selection/randomized/tests/test_naive.py
selection/randomized/tests/test_qp.py
selection/randomized/tests/test_randomization.py
selection/randomized/tests/test_selective_MLE.py
selection/randomized/tests/test_selective_MLE_high.py
selection/randomized/tests/test_selective_MLE_onedim.py
selection/randomized/tests/test_slope.py
selection/randomized/tests/test_slope_subgrad.py
selection/randomized/tests/test_topK.py
selection/sampling/__init__.py
selection/sampling/api.py
selection/sampling/langevin.py
selection/sampling/sequential.py
selection/sampling/sqrt_lasso.pyx
selection/sampling/truncnorm.pyx
selection/sampling/truncnorm_quadratic.pyx
selection/sampling/tests/__init__.py
selection/sampling/tests/plots_fs.py
selection/sampling/tests/test_fstep_langevin.py
selection/sampling/tests/test_kfstep.py
selection/sampling/tests/test_pca_langevin.py
selection/sampling/tests/test_sample_sphere.py
selection/sampling/tests/test_sequential.py
selection/tests/__init__.py
selection/tests/decorators.py
selection/tests/flags.py
selection/tests/instance.py
selection/tests/test_instance.py
selection/tests/tests.py
selection/truncated/F.py
selection/truncated/T.py
selection/truncated/__init__.py
selection/truncated/api.py
selection/truncated/base.py
selection/truncated/chi.py
selection/truncated/gaussian.py
selection/truncated/tests/__init__.py
selection/truncated/tests/test_truncated.py
selection/truncated/tests/test_truncatedFT.py
selection/utils/__init__.py
selection/utils/tools.py
tools/apigen.py
tools/build_modref_templates.py
tools/gitwash_dumper.py
tools/nbtools.py
tools/noseall_with_coverage
tools/strip_notebook.py
1 change: 1 addition & 0 deletions selection.egg-info/dependency_links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions selection.egg-info/not-zip-safe
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

7 changes: 7 additions & 0 deletions selection.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Cython>=0.21

[doc]
Sphinx>=1.0

[test]
nose>=0.10.1
1 change: 1 addition & 0 deletions selection.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
selection
21 changes: 21 additions & 0 deletions selection/constraints/affine.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,30 @@ def whiten(self):
"""
sqrt_cov, sqrt_inv = self.covariance_factors()[:2]

# if np.isnan(sqrt_cov).any():
# print("sqrt cov has nan:", sqrt_cov)
# if (sqrt_cov==0).any():
# print("sqrt cov has 0:", sqrt_cov)
# if np.isnan(sqrt_inv).any():
# print("sqrt inv has nan:", sqrt_inv)
# if (sqrt_inv==0).any():
# print("sqrt inv has 0:", sqrt_inv)
# print("linear part", self.linear_part)

new_A = self.linear_part.dot(sqrt_cov)
# if np.isnan(new_A).any():
# print("new_A has nan:", new_A)
# if (new_A==0).any():
# print("new_A has 0:", new_A)
den = np.sqrt((new_A**2).sum(1))
# if np.isnan(den).any():
# print("den has nan:", den)
# if (den==0).any():
# print("den has 0:", den)
# print("sqrt cov col sums:", sqrt_cov.sum(1))
new_b = self.offset - self.linear_part.dot(self.mean)
# if np.isnan(new_b).any():
# print("new_b has nan:", new_b)
new_con = constraints(new_A / den[:,None], new_b / den)

mu = self.mean.copy()
Expand Down
Binary file added selection/randomized/.DS_Store
Binary file not shown.
Loading