Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
568 commits
Select commit Hold shift + click to select a range
5f971f6
rob added unifTest.R
tibshirani Oct 11, 2017
42fc515
rob modified unifTest.R
tibshirani Oct 11, 2017
781609d
rob modified unifTest.R
tibshirani Oct 11, 2017
3da6c50
NF: density functions for randomized LASSO
jonathan-taylor Oct 25, 2017
e0eb1c6
T to TRUE
jonathan-taylor Oct 25, 2017
b23b189
updated wide C code -- can now do ridge as well as variable weights -…
jonathan-taylor Oct 26, 2017
ffccea5
removing machine generated files
jonathan-taylor Oct 26, 2017
2c0e3d6
WIP: function to fit randomized lasso
jonathan-taylor Oct 26, 2017
2439d73
check that solution is same as old code -- currently failing
jonathan-taylor Oct 27, 2017
83b0426
bug found in qp solver -- look at tests/test_QP.R
jonathan-taylor Oct 27, 2017
f13bce4
allowing randomization to be 0 in solver
jonathan-taylor Oct 27, 2017
a6064f2
cosmetic edit
jonathan-taylor Oct 27, 2017
2d685c0
LASSO solver is right up to scale
jonathan-taylor Oct 27, 2017
cc88b97
Confidence intervals when estimate is negative
nicoballarini Oct 27, 2017
7b23150
Confidence intervals when estimate is negative
nicoballarini Oct 27, 2017
928fee9
variable rename
jonathan-taylor Oct 11, 2017
2e9b11d
NF: density functions for randomized LASSO
jonathan-taylor Oct 25, 2017
c3b55f5
T to TRUE
jonathan-taylor Oct 25, 2017
3748723
updated wide C code -- can now do ridge as well as variable weights -…
jonathan-taylor Oct 26, 2017
5a07245
removing machine generated files
jonathan-taylor Oct 26, 2017
ede2816
WIP: function to fit randomized lasso
jonathan-taylor Oct 26, 2017
32feb0e
check that solution is same as old code -- currently failing
jonathan-taylor Oct 27, 2017
0a99f5f
bug found in qp solver -- look at tests/test_QP.R
jonathan-taylor Oct 27, 2017
242218e
allowing randomization to be 0 in solver
jonathan-taylor Oct 27, 2017
360dcbd
cosmetic edit
jonathan-taylor Oct 27, 2017
f5a3b96
LASSO solver is right up to scale
jonathan-taylor Oct 27, 2017
506a205
BF: fixing Xsoln incorrectly set in wide solver
jonathan-taylor Oct 27, 2017
0be39c4
gradient not current?
jonathan-taylor Oct 27, 2017
3ee2a43
print R2 from lm
jonathan-taylor Oct 27, 2017
92812fc
without linesearch we know agree with Adel's code at fixed mu
jonathan-taylor Oct 27, 2017
abf0824
fixing documentation
jonathan-taylor Oct 27, 2017
1658ecb
checking comparison example again -- looks good
jonathan-taylor Oct 27, 2017
e3049cf
removing the offset_correction which was just for the comparison
jonathan-taylor Oct 27, 2017
32d4bd5
Merge pull request #35 from nicoballarini/patch-1
jonathan-taylor Oct 27, 2017
4e42c75
Merge pull request #34 from nicoballarini/patch-2
jonathan-taylor Oct 27, 2017
fc49dcd
created the matrices for the affine transform, wrapper for calling Ga…
jonathan-taylor Oct 28, 2017
d1dc82d
unwanted files
jonathan-taylor Oct 28, 2017
8ca2028
wrapper for conditional density
jonathan-taylor Oct 28, 2017
07d7c6c
forming internal affine transform
jonathan-taylor Oct 28, 2017
9d1c79b
vectorized densities evaluate OK -- need to check results
jonathan-taylor Oct 28, 2017
5393dcd
added laplace densities
jonathan-taylor Oct 28, 2017
b637448
using C-software submodule for selectiveInference/src
jonathan-taylor Oct 31, 2017
39b9675
updating travis script
jonathan-taylor Oct 31, 2017
cd918b1
variable rename
jonathan-taylor Oct 11, 2017
ac2bbc8
NF: density functions for randomized LASSO
jonathan-taylor Oct 25, 2017
75c71dc
T to TRUE
jonathan-taylor Oct 25, 2017
49d0b67
updated wide C code -- can now do ridge as well as variable weights -…
jonathan-taylor Oct 26, 2017
0dbc310
removing machine generated files
jonathan-taylor Oct 26, 2017
7480310
WIP: function to fit randomized lasso
jonathan-taylor Oct 26, 2017
38b2020
check that solution is same as old code -- currently failing
jonathan-taylor Oct 27, 2017
dc423de
bug found in qp solver -- look at tests/test_QP.R
jonathan-taylor Oct 27, 2017
71ff6e3
allowing randomization to be 0 in solver
jonathan-taylor Oct 27, 2017
de8874b
cosmetic edit
jonathan-taylor Oct 27, 2017
07f738c
LASSO solver is right up to scale
jonathan-taylor Oct 27, 2017
2f1686e
BF: fixing Xsoln incorrectly set in wide solver
jonathan-taylor Oct 27, 2017
6444472
gradient not current?
jonathan-taylor Oct 27, 2017
9f26844
print R2 from lm
jonathan-taylor Oct 27, 2017
9c7bfcc
without linesearch we know agree with Adel's code at fixed mu
jonathan-taylor Oct 27, 2017
c2460a1
fixing documentation
jonathan-taylor Oct 27, 2017
ce15b68
checking comparison example again -- looks good
jonathan-taylor Oct 27, 2017
e01d8f1
removing the offset_correction which was just for the comparison
jonathan-taylor Oct 27, 2017
eedf0fd
created the matrices for the affine transform, wrapper for calling Ga…
jonathan-taylor Oct 28, 2017
e8a94ef
unwanted files
jonathan-taylor Oct 28, 2017
b2de9d9
wrapper for conditional density
jonathan-taylor Oct 28, 2017
6dfdd0d
forming internal affine transform
jonathan-taylor Oct 28, 2017
c175a8b
vectorized densities evaluate OK -- need to check results
jonathan-taylor Oct 28, 2017
c940537
added laplace densities
jonathan-taylor Oct 28, 2017
206e236
BF: variable rename
jonathan-taylor Oct 31, 2017
2917d6e
BF: forgot to cd up directory
jonathan-taylor Oct 31, 2017
63e60df
changing order of stop arguments
jonathan-taylor Oct 31, 2017
57d91d4
changing order of stops
jonathan-taylor Oct 31, 2017
ff598d0
Merge pull request #36 from jonathan-taylor/master
tibshirani Oct 31, 2017
46713f0
Merge branch 'master' into cython
jonathan-taylor Oct 31, 2017
232760d
Merge pull request #37 from jonathan-taylor/master
jonathan-taylor Oct 31, 2017
50601d2
merging with upstream
jonathan-taylor Nov 1, 2017
f774483
unused import
jonathan-taylor Nov 1, 2017
da1b9b5
column major ordering in C library
jonathan-taylor Nov 1, 2017
8bd3c12
tests are in different directory
jonathan-taylor Nov 1, 2017
89c115e
Merge pull request #38 from jonathan-taylor/master
jonathan-taylor Nov 1, 2017
ae9aec8
WIP: have sample from optimization density, importance weight -- need…
jonathan-taylor Nov 2, 2017
177ab78
update to C-software, using a compiler define for column major
jonathan-taylor Nov 3, 2017
1d60dfa
update to C-software, using a compiler define for column major
jonathan-taylor Nov 3, 2017
3ce4ea2
pivots running but weights all zero
Nov 5, 2017
555f38c
reorg
Nov 5, 2017
fdff629
segfault error
Nov 6, 2017
68e27f4
bug in weights
Nov 6, 2017
0fa7c4e
condl bug fixed
Nov 6, 2017
8f99570
added ci
Nov 6, 2017
9597497
removed local import
jonathan-taylor Nov 6, 2017
a8d50a6
Merge branch 'jelena-markovic-randomized_jelena'
jonathan-taylor Nov 6, 2017
71b6586
BF: segfault seems fixed -- ensured all functions have some order of …
jonathan-taylor Nov 7, 2017
e0ee2a7
jelena's inference functions
jonathan-taylor Nov 7, 2017
09db28a
BF: seems ncase and nfeature were swapped in some places in C code
jonathan-taylor Nov 7, 2017
95b98c2
minor cleanup -- doesn't seem to use conditional_density?
jonathan-taylor Nov 7, 2017
a1ad181
Merge pull request #1 from jonathan-taylor/master
Nov 7, 2017
07b6bb7
coverages
Nov 7, 2017
1115635
subgrad condition option added
Nov 7, 2017
e2f4585
bug
Nov 7, 2017
df777e3
using some default arguments now -- bug in C code for densities
jonathan-taylor Nov 7, 2017
ff34a52
dealing with zero length active set
Nov 7, 2017
1c538ed
Merge branch 'jelena-markovic-randomized_jelena'
jonathan-taylor Nov 7, 2017
ab91969
now nut running after trying to set default arguments
jonathan-taylor Nov 7, 2017
5b4bc08
BF: estimate of sigma
jonathan-taylor Nov 7, 2017
46856e1
changing arguments
jonathan-taylor Nov 7, 2017
d1ebca3
BF: noise_scale was NULL
jonathan-taylor Nov 7, 2017
0f1833f
seems to be running now with default arguments
jonathan-taylor Nov 7, 2017
8187b53
forgot one bit of C code to use
jonathan-taylor Nov 7, 2017
6dae27c
weights running in |E|+1 dimensions
Nov 7, 2017
e90a8f1
BF: opt_transform linear_term was not cast as matrix in conditional_d…
jonathan-taylor Nov 7, 2017
2b49b94
working instance
Nov 8, 2017
571cf82
export of randomized and man page
jonathan-taylor Nov 8, 2017
9adbe9b
adding resid to namespace
jonathan-taylor Nov 8, 2017
eda1482
fixing to make check pass
jonathan-taylor Nov 8, 2017
3ca4431
param_stop
jonathan-taylor Nov 8, 2017
d838b07
merged with smaller dimensional matrices
jonathan-taylor Nov 8, 2017
7f8b8fd
For gaussian randomization, remove all p-dimensional matrices
jonathan-taylor Nov 8, 2017
690f0ea
fixing function signature
jonathan-taylor Nov 8, 2017
9e7a081
Merge pull request #39 from jonathan-taylor/master
tibshirani Nov 8, 2017
6c1a123
added mean and cov of a gaussian
Nov 8, 2017
d2a3b9b
transpose
Nov 8, 2017
e2efbdc
working! bugs fixed. new sampler
Nov 9, 2017
e739255
active set zero
Nov 9, 2017
b4fd8b5
removed set seed when gen randomization
Nov 9, 2017
d2438c9
amir sampler working with subgrad condition false as well
Nov 9, 2017
ce13171
logistic
Nov 9, 2017
157c1db
E of zero length
Nov 10, 2017
1dfbea8
fixing man page so check passes
jonathan-taylor Nov 10, 2017
fa08285
Merge branch 'jelena-markovic-randomized_jelena'
jonathan-taylor Nov 10, 2017
b21260a
renaming file
jonathan-taylor Nov 10, 2017
183bc3a
stop instead of print
jonathan-taylor Nov 10, 2017
4fc539d
Merge branch 'master' into logistic
jonathan-taylor Nov 10, 2017
42cd878
WIP: adding logistic option, need to solve logistic problem
jonathan-taylor Nov 10, 2017
69bf473
Merge branch 'jelena-markovic-logistic'
jonathan-taylor Nov 10, 2017
af3b818
fixing empty inactive set indexing problem
jonathan-taylor Nov 10, 2017
a2e32dc
Merge pull request #41 from jonathan-taylor/master
tibshirani Nov 10, 2017
291aa66
logistic solver
Nov 10, 2017
bb5fe6b
bug fixes to logistic solver
jonathan-taylor Nov 10, 2017
98e7689
smaller lambda
jonathan-taylor Nov 11, 2017
1a27dc8
logistic not working well
Nov 11, 2017
aa6b5b7
randomized logistic working
Nov 11, 2017
f3f155e
BF: rob's bug with nactive=p-1
jonathan-taylor Nov 11, 2017
8e7f924
Merge branch 'randomized_logistic' of https://github.com/jelena-marko…
jonathan-taylor Nov 11, 2017
67e8e29
removing Rcpp file, few edits to randomized funs
jonathan-taylor Nov 11, 2017
62b673e
Merge branch 'jelena-markovic-randomized_logistic'
jonathan-taylor Nov 11, 2017
86cffd6
WIP: separating conditional density, and the lasso soln as argument t…
jonathan-taylor Nov 12, 2017
6f4fc0d
WIP: matrices not right size
jonathan-taylor Nov 12, 2017
3487b71
RF: randomizedLassoInf now takes a randomizedLasso soln
jonathan-taylor Nov 12, 2017
8796029
DOC: exported randomizedLasso, and updated docs
jonathan-taylor Nov 12, 2017
b708081
updating C-software
jonathan-taylor Nov 12, 2017
cabc4d9
NF: targets can be passed to randomizedLassoInf
jonathan-taylor Nov 13, 2017
c9d9ed1
BF: unused sigma argument in test
jonathan-taylor Nov 13, 2017
b86e1a4
slightly bigger sampler for logistic
jonathan-taylor Nov 13, 2017
3060100
possibility of different randomization scales for binomial, gaussian
jonathan-taylor Nov 13, 2017
08294ca
DOC: fixing Rd files for return values
jonathan-taylor Nov 13, 2017
194ddda
BF: missed some drop=FALSE; RF: using glm to do the work for covariance
jonathan-taylor Nov 14, 2017
b26e152
function imports
jonathan-taylor Nov 14, 2017
9de1b7c
rob chanegd NAMESPACE
tibshirani Nov 15, 2017
5ea21ba
check for failure to fit relaxed estimator
jonathan-taylor Nov 16, 2017
c35bafd
small merge conflict
jonathan-taylor Nov 17, 2017
84cb2cb
BF: trying not to form large matrices
jonathan-taylor Nov 17, 2017
488016f
BF: wrong variable name
jonathan-taylor Nov 17, 2017
6ccebc1
BF: variable name
jonathan-taylor Nov 17, 2017
f7a222d
BF: don't form X_minusE, make a shortcut for X
jonathan-taylor Nov 17, 2017
ff4ed8a
timing script runs now -- needs testing to see if anything broken
jonathan-taylor Nov 17, 2017
9b9c7b2
DOC: fixed to pass check, as.vector for y
jonathan-taylor Nov 17, 2017
74a2ab5
active_set not returned -- just targets
jonathan-taylor Nov 17, 2017
f127d6f
DOC: changing comment
jonathan-taylor Nov 17, 2017
693a138
signs changed
Nov 18, 2017
a2b0ee5
Merge pull request #9 from jelena-markovic/randomized
jonathan-taylor Nov 18, 2017
e811fd5
adding names to pvalues and ci
jonathan-taylor Nov 18, 2017
f0dc196
burnin for noreject sampler
jonathan-taylor Nov 18, 2017
5303a72
removing print statement
jonathan-taylor Nov 18, 2017
657c69d
BF: burnin now handled in samples
jonathan-taylor Nov 18, 2017
42d31aa
updating C-software
jonathan-taylor Nov 21, 2017
a982089
speeding up root finding
jonathan-taylor Nov 21, 2017
a5208c6
trying to speed up importance weights -- broke it?
jonathan-taylor Nov 21, 2017
d3bbf07
using the cholesky as before to see if it helps
jonathan-taylor Nov 21, 2017
a784aa4
looking at other way to compute sufficient_stat
jonathan-taylor Nov 21, 2017
c3936c1
removing print statements
jonathan-taylor Nov 21, 2017
b2f51ec
computing sufficient stat directly from importance weight
jonathan-taylor Nov 21, 2017
05ab771
rob's nonnull test -- needs work to run with master
jonathan-taylor Nov 21, 2017
b7e70b7
rob's nonnull test
jonathan-taylor Nov 21, 2017
b988ba6
no longer need second cholesky
jonathan-taylor Nov 21, 2017
2150080
rewriting sufficient stat to avoid NaN
jonathan-taylor Nov 22, 2017
bb910dc
removing debug statements
jonathan-taylor Nov 22, 2017
b01a0af
BF: finished new sufficient stat
jonathan-taylor Nov 22, 2017
62d5cbc
two new timing scripts
jonathan-taylor Nov 22, 2017
c9dffae
added randomized debiased
Nov 26, 2017
e90c9a6
back to targets
Nov 27, 2017
049a7ee
cross cov was wrong
Nov 29, 2017
df37d54
changed pivot
Nov 29, 2017
ca4a341
added twosided pivots option and constructing ci and pvalues as options
Nov 30, 2017
7823150
Merge pull request #12 from jelena-markovic/master
jonathan-taylor Feb 13, 2018
c9a7752
including conditional mean and covariance
jonathan-taylor Feb 13, 2018
63f8966
Merge branch 'master' of github.com:jonathan-taylor/R-selective
jonathan-taylor Feb 13, 2018
6d82996
added full code
Mar 20, 2018
47d26d5
comparisons
Mar 21, 2018
daa5125
tests
Mar 22, 2018
ba79191
selective plus BH added
Mar 22, 2018
24c8fc7
randomized test
Mar 22, 2018
f0db032
cluster files
Mar 22, 2018
b1fbe5e
cluster files again
Mar 22, 2018
4bead7c
cluster again
Mar 22, 2018
bb1f92f
added cluster files for all methods
Mar 22, 2018
ca4e19a
added cluster files for all methods
Mar 22, 2018
e3d4b2d
cluster can do all six methods now
Mar 22, 2018
9b3a094
real data analysis
Mar 26, 2018
a097719
BF: doc mismatch
jonathan-taylor Mar 26, 2018
5eccc1f
BF in C code
jonathan-taylor Mar 26, 2018
6d82790
BF in C code
jonathan-taylor Mar 26, 2018
09ec5ed
Merge branch 'randomized_lasso_edit'
jonathan-taylor Mar 26, 2018
c10004e
real data
Mar 26, 2018
d5ec2aa
got rid of Q
Mar 26, 2018
d61ddcf
fixing gitignore to ignore selectiveInference/src code
jonathan-taylor Mar 28, 2018
737b48a
removing reference to self library
jonathan-taylor Mar 29, 2018
cabeba0
Merge branch 'master' into full
jonathan-taylor Mar 29, 2018
af2698f
adding Jelena as an author
jonathan-taylor Mar 29, 2018
f50b5fe
Merge branch 'full' of https://github.com/jelena-markovic/R-selective…
jonathan-taylor Mar 29, 2018
224681b
ignore csv and rds files under tests
jonathan-taylor Mar 29, 2018
5014544
trying to add path to Makevars
jonathan-taylor Mar 29, 2018
67dafd7
disabling old for now due to Rmpfr not installing on old travis
jonathan-taylor Mar 30, 2018
3f96000
removing data files, and C files that are synced automatically from C…
jonathan-taylor Mar 30, 2018
6ea54a5
disambgiuating argument
jonathan-taylor Mar 30, 2018
1caebe2
fixing import of p.adjust
jonathan-taylor Mar 30, 2018
05f4d6c
sigma import
jonathan-taylor Mar 30, 2018
791a7c8
removed rds files
Mar 30, 2018
5c056ea
Merge branch 'master' into full_new
jonathan-taylor Mar 30, 2018
fc9605a
Merge branch 'jelena-markovic-full' into full_new
jonathan-taylor Mar 30, 2018
eed2e4a
adding gglasso dependence, using solve instead of ginv
jonathan-taylor Mar 30, 2018
2918b0d
Merge branch 'full_new' of https://github.com/jelena-markovic/R-selec…
jonathan-taylor Mar 30, 2018
b406816
removing C code
jonathan-taylor Mar 30, 2018
f7684e0
Merge branch 'jelena-markovic-full_new' into jelena-markovic-full
jonathan-taylor Mar 30, 2018
523216f
more rds files
jonathan-taylor Mar 30, 2018
97f87e0
using Q_sq NULL arg
jonathan-taylor Mar 30, 2018
cfb7044
adding line about testing
jonathan-taylor Mar 30, 2018
ef43b78
Merge pull request #16 from jonathan-taylor/jelena-markovic-full
jonathan-taylor Mar 30, 2018
a0b732f
deleting test scripts
jonathan-taylor Mar 30, 2018
c8bd4ea
Q_sq added back
Apr 2, 2018
09731d8
moved comparisons to the dropbox
Apr 3, 2018
7268dcd
moved comparisons to the dropbox
Apr 3, 2018
e9e0079
fixing signature of truncation set
jonathan-taylor Apr 3, 2018
2d396e7
Merge branch 'jelena-markovic-full_new'
jonathan-taylor Apr 3, 2018
b3bc535
fixing indentation
jonathan-taylor Apr 5, 2018
ba5a68d
cleanup? of approximate
jonathan-taylor Apr 5, 2018
e2ebc99
rewrote approximate a bit more using only rows of inverse, not multip…
jonathan-taylor Apr 5, 2018
6b50cdb
adding verbose argument
jonathan-taylor Apr 5, 2018
8a2a30a
indentation fix
jonathan-taylor Apr 7, 2018
781c516
Added type='full' for logistic and removed Xordered from gaussian and…
kevinbfry Apr 8, 2018
20ea9c7
added scaling of vlo, vup, and sd to account for use of local alterna…
kevinbfry Apr 21, 2018
b24bb31
added 'full' as argument option in fixedLogitLassoInf
kevinbfry Apr 21, 2018
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
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
*.rds
tests/*.rds
tests/*/*.rds
tests/*/*/*.rds
tests/*.csv
tests/*/*.csv
tests/*/*/*.csv
**DS_Store**
**Rcheck**
**tar.gz
**Rapp.history
**.pdf
**.RData
**.o
**.so
forLater/josh/**
*/R/RcppExports.R
*/src/RcppExports.cpp
*~
*/*~
*/*/*~
# this code is copied from C-software
selectiveInference/src/matrixcomps.*
selectiveInference/src/debias.*
selectiveInference/src/randomized_lasso.*
selectiveInference/src/quadratic_program*.c
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "C-software"]
path = C-software
url = https://github.com/selective-inference/C-software.git
21 changes: 21 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
language: r
cache: packages
sudo: false
r:
#- oldrel
- release
- devel
addons:
apt:
packages: libmpfr-dev
warnings_are_errors: true
before_install:
- tlmgr install index # for texlive and vignette?
- R -e 'install.packages(c("Rcpp", "intervals", "adaptMCMC", "glmnet"), repos="http://cloud.r-project.org")'
- cd C-software
- git submodule init
- git submodule update
- cd ..
- make src
- make Rcpp
- cd selectiveInference
1 change: 1 addition & 0 deletions C-software
Submodule C-software added at aca77f
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Rcpp:
- rm -f selectiveInference/src/RcppExports.cpp
- rm -f selectiveInference/R/RcppExports.R
Rscript -e "library(Rcpp); Rcpp::compileAttributes('selectiveInference')"

install: Rcpp src
R CMD INSTALL selectiveInference

build: src
R CMD build selectiveInference

src:
cp C-software/src/* selectiveInference/src

check: Rcpp build
R CMD build selectiveInference
R CMD check selectiveInference_1.2.2.tar.gz # fix this to be a script variable
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# R-software
R software for [selective inference](http://cran.r-project.org/web/packages/selectiveInference/).
Authors: Ryan Tibshirani, Rob Tibshirani, Jonathan Taylor, Joshua Loftus, Stephen Reid, Jelena Markovic
Maintainer: Rob Tibshirani <tibs@stanford.edu>

New tools for inference after selection, for use with forward stepwise regression, least angle regression, the lasso, and the many means problem. The package is available on [CRAN](http://cran.r-project.org/web/packages/selectiveInference/). See [this paper](http://www.pnas.org/content/112/25/7629.full) for a high level introduction to selective inference.

Code is in the directory selectiveInference/R.
* funs.common.R: Basic functions used by many other functions, such as standardization.
* funs.fixed.R: Inference for LASSO at a fixed, deterministic value of lambda.
* funs.fs.R: Inference for forward stepwise.
* funs.groupfs.R: Inference for forward stepwise with groups of variables, e.g. factors.
* funs.inf.R: Common functions for inference with fixed, fs, lar, and manymeans (but not group).
* funs.lar.R: Inference for least angle regression.
* funs.max.R: Some numerical approximations. Deprecated?

## Installation
The latest release of the package can be installed through CRAN:

```R
install.packages("selectiveInference")
```
Code in repo is under development and may be unstable.

## For development

You will have to run

```
make Rcpp
```

## To test

```
make check
```

These tests are also run on [travis](http://travis-ci.org) based on .travis.yml setup.
70 changes: 70 additions & 0 deletions forLater/estimateLambda.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
\name{estimateLambda}
\alias{estimateLambda}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
Estimates the lasso tuning parameter lambda.
}
\description{
Estimates the lasso tuning parameter lambda, for use in the selectiveInference
package
}
\usage{
estimateLambda(x, sigma, nsamp=1000)
}
\arguments{
\item{x}{
Matrix of predictors (n by p)
}
\item{sigma}{
Estimate of error standard deviation
}
\item{nsamp}{Number of Monte carlo samples used for the estimation.}
}
\details{
This function estimates the lasso tuning parameter lambda, using the estimate
2*E(||X^T eps||_infty) where eps ~ N(0,sigma^2), a vector of length n.
This estimate was proposed by Negahban et al (2012).
}
\value{
\item{sigmahat}{The estimate of sigma}
\item{df}{The degrees of freedom of lasso fit used}
}
\references{
Negahban, S. N.,
Ravikumar, P.,
Wainwright, M. J.
and Yu, B.
(2012). A unified
framework for high-dimensional analysis of
M-estimators with decomposable regularizers.
Statistical Science vol. 27, p 538-557.
}

\author{Ryan Tibshirani, Rob Tibshirani, Jonathan Taylor, Joshua Loftus, Stephen Reid}

\examples{
#NOT RUN
#set.seed(43)
#n=50
#p=10
#sigma=.7
#x=matrix(rnorm(n*p),n,p)
#x=scale(x,T,F)
#beta=c(3,2,0,0,rep(0,p-4))
#y=x%*%beta+sigma*rnorm(n)
#y=y-mean(y)
#
#estimate lambda usingthe known value of sigma
#lamhat=estimateLambda(x,sigma=.7)
#
#first estimate sigma
#sigmahat=estimateSigma(x,y)$sigmahat
#lamhat=estimateLambda(x,sigma=sigmahat)

#compare to estimate from cv

#out=cv.glmnet(x,y)
#out$lambda.min*n #remember that value from glmnet must be
# multiplied by n, to make it comparable.
}

81 changes: 81 additions & 0 deletions forLater/fixedLassoPoly.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
\name{fixedLassoPoly}
\alias{fixedLassoPoly}

\title{
Compute polyhedral constraints for a LASSO problem with
a fixed value of lambda.
}
\description{
Compute polyhedral representation of the selection region of Lee et al. (2016).
By construction, y should satisfy A %*% y elementwise less then or equal b.
}
\usage{
fixedLassoPoly(X, y, lambda, beta, active, inactive = FALSE)
}
\arguments{
\item{X}{
Design matrix of LASSO problem.
}
\item{y}{
Response of LASSO problem.
}
\item{lambda}{
Value of regularization parameter.
}
\item{beta}{
Solution of LASSO problem with regularization parameter set to lambda.
}
\item{active}{
Active set of the LASSO problem as a boolean vector. Should correspond
to the non-zeros of beta.
}
\item{inactive}{
Form the inactive constraints as well?
}
}
\details{
This function computes
the polyhedral representation of the selection region of Lee et al. (2016).
}

\value{
\item{A}{Linear part of the affine inequalities.}
\item{b}{RHS offset the affine inequalities.}
}

\references{
Jason Lee, Dennis Sun, Yuekai Sun, and Jonathan Taylor (2016).
Exact post-selection inference, with application to the lasso. Annals of Statistics, 44(3), 907-927.

Jonathan Taylor and Robert Tibshirani (2017) Post-selection inference for math L1-penalized likelihood models.
Canadian Journal of Statistics, xx, 1-21. (Volume still not posted)
}
\author{Ryan Tibshirani, Rob Tibshirani, Jonathan Taylor, Joshua Loftus, Stephen Reid}

\examples{

set.seed(43)
n = 50
p = 10
sigma = 1

x = matrix(rnorm(n*p),n,p)
x = scale(x,TRUE,TRUE)

beta = c(3,2,rep(0,p-2))
y = x\%*\%beta + sigma*rnorm(n)

# first run glmnet
gfit = glmnet(x,y,standardize=FALSE)

# extract coef for a given lambda; note the 1/n factor!
# (and we don't save the intercept term)
lambda = .8
beta = coef(gfit, s=lambda/n, exact=TRUE)[-1]
active = (beta != 0)

fixedLassoPoly(x, y, lambda, beta, active)
fixedLassoPoly(x, y, lambda, beta, active, inactive=TRUE)

}

Loading