Description Usage Arguments Value Author(s) References See Also Examples
Variable selection with GLMlasso or Squareroot lasso choosing the penalty parameter λ with the Quantile Universal Threshold. The procedure goes towards sparse estimation of the coefficients for good selection of the important predictors.
1 2 3 4 5  qut(y,X,fit,family=gaussian,alpha.level=0.05,M=1000,qut.standardize=TRUE,
intercept=TRUE,offset=NULL,bootstrap=TRUE,sigma=ifelse(n>2*p,'ols','qut'),beta0='iterglm',
estimator='unbiased',type=c('glmnet','lars','flare'),lambda.seq=0,penalty.factor=rep(1,p),
lambda.min.ratio=ifelse(n<p,0.01,0.0001),nlambda=ifelse(type=='flare',2,100),
lambda=NULL,...)

y 
response variable. Quantitative for family= 
X 
input matrix, of dimension n x p; each row is an observation vector. 
fit 
a user supplied 
family 
response type (see above). Default is 
alpha.level 
level, such that quantile τ=(1 
M 
number of Monte Carlo Simulations to estimate the distribution Λ. Default is 1000. 
qut.standardize 
standardize matrix X with a quantilebased standardization. Default is TRUE. It is not used for sqrtlasso. 
intercept 
should intercept(s) be fitted (default=TRUE) or set to zero (FALSE). 
offset 
a vector of length 
bootstrap 
set TRUE if it is desired to bootstrap matrix X when computing the Quantile Universal Threshold (Random scenario). Default is TRUE. 
sigma 
standard deviation of the Gaussian errors. Used only if family= 
beta0 
coefficients of the unpenalized covariates for generating the null data for the Quantile Universal Threshold. When is 'iterglm' (Default) or 'iter', it is estimated using one step iteration of the entire procedure with maximum likelihood estimation or the lasso estimation, respectively. If 'noiter' then it is estimated without iterating.
If it is desired to set 
estimator 
type of estimation of sigma when 
type 
algorithm for solving the optimization problem. It can be 
lambda.seq 
preset lambda sequence when type = 'glmnet'. If 
penalty.factor 
separate penalty factors can be applied to each coefficient. This is a number that multiplies lambda to allow differential shrinkage. Can be 0 for some variables, which implies no shrinkage, and that variable is always included in the model. Default is 1 for all variables (and implicitly infinity for variables listed in exclude). Note: the penalty factors are internally rescaled to sum to n, and the lambda sequence will reflect this change. 
lambda.min.ratio 
smallest value for lambda, as a fraction of 
nlambda 
the number of 
lambda 
a user supplied 
... 

lambda 
value of the Quantile Universal Threshold. 
fit 
object fitted by 
beta 
coefficients obtained with the Quantile Universal Threshold. 
betaglm 
coefficients obtained fitting GLM with the non zero coefficients in 
beta0 
estimated value of the intercept when family is not 
family 
response type 
sigma 
standard deviation estimate of the errors (when family= 
scale.factor 
scale factor used for standardizing X. 
Jairo Diaz Rodriguez
C. Giacobino, J. Diaz, S. Sardy, N. Hengartner. Quantile universal threshold for model selection. 2016 Jianqing Fan, Shaojun Guo and Ning Hao. Variance estimation using refitted crossvalidation in ultrahigh dimensional regression. Journal of the Royal Statistical Society: Series B. 2012 Stephen Reid, Robert Tibshirani, and Jerome Friedman. A Study of Error Variance Estimation in Lasso Regression. 2013
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  set.seed(1234)
X=matrix(rnorm(50*500),50,500)
beta=c(rep(10,5),rep(0,5005))
y=X %*% beta+rnorm(50)
outqut=qut(y,X,type='glmnet',family=gaussian,sigma=1) #Fitting with qut
betaqut=outqut$beta[1]
outcv=cv.glmnet(X,y,family='gaussian') #fitting with CrossValidation
betacv=coef(outcv$glmnet.fit,s=outcv$lambda.min)[1]
results=rbind( c(sum(betaqut[1:5]!=0),sum(betaqut[(1:5)]!=0)),
c(sum( betacv[1:5]!=0), sum(betacv[(1:5)]!=0)) )
colnames(results)=c('True Positive','False Positive')
rownames(results)=c('qut','cv')
print(results)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.