Skip to content

Commit 8b81a9f

Browse files
more cleanup
1 parent aeef620 commit 8b81a9f

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

selectiveInference/R/funs.randomized.R

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,7 @@ randomizedLassoInf = function(rand_lasso_soln,
459459
sampler=c("norejection", "adaptMCMC"),
460460
nsample=10000,
461461
burnin=2000,
462-
opt_samples=NULL,
463-
target_samples=NULL)
462+
opt_samples=NULL)
464463
{
465464

466465
n = nrow(rand_lasso_soln$X)
@@ -519,7 +518,6 @@ randomizedLassoInf = function(rand_lasso_soln,
519518
names(pvalues) = names(targets$observed_target)
520519
rownames(ci) = names(targets$observed_target)
521520

522-
523521
target_samples = mvrnorm(nrow(as.matrix(opt_samples)),rep(0,nactive),targets$cov_target)
524522

525523
for (i in 1:nactive){
@@ -584,11 +582,10 @@ randomizedLassoInf = function(rand_lasso_soln,
584582

585583
return_list = list(targets=targets,
586584
pvalues=pvalues,
587-
ci=ci)
588-
if (for_test) {
589-
return_list$opt_samples=opt_samples
590-
return_list$target_samples=target_samples
591-
}
585+
ci=ci,
586+
opt_samples=opt_samples,
587+
target_samples=target_samples)
588+
592589
return(return_list)
593590
}
594591

selectiveInference/man/randomizedLassoInf.Rd

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ randomizedLassoInf(rand_lasso_soln,
1616
level=0.9,
1717
sampler=c("norejection", "adaptMCMC"),
1818
nsample=10000,
19-
burnin=2000)
19+
burnin=2000,
20+
opt_samples=NULL,
21+
target_samples=NULL)
2022
}
2123
\arguments{
2224
\item{rand_lasso_soln}{
@@ -48,6 +50,9 @@ Number of samples of optimization variables to sample.
4850
\item{burnin}{
4951
How many samples of optimization variable to discard (should be less than nsample).
5052
}
53+
\item{opt_samples}{
54+
Optional sample of optimization variables. If not NULL then no MCMC will be run.
55+
}
5156
}
5257

5358
\details{

0 commit comments

Comments
 (0)