Standard errors for lasso prediction using R I'm trying to use a LASSO model for prediction, and I need to estimate standard errors. Surely someone has already written a  package to do this. But as far as I can see, none of the packages on CRAN that do predictions using a LASSO will return standard errors for those predictions.
So my question is: Is there a package or some R code available to compute standard errors for LASSO predictions?
 A: Kyung et al. (2010), "Penalized regression, standard errors, & Bayesian lassos", Bayesian Analysis , 5, 2, suggest that there might not be a consensus on a statistically valid method of calculating standard errors for the lasso predictions. Tibshirani seems to agree (slide 43) that standard errors are still an unresolved issue.
A: There is the selectiveInference package in R, https://cran.r-project.org/web/packages/selectiveInference/index.html, that provides confidence intervals and p values for your coefficients fitted by the LASSO, based on the following paper:
Stephen Reid, Jerome Friedman, and Rob Tibshirani (2014). A study of error variance estimation in lasso regression. arXiv:1311.5274
PS: just realise that this produces error estimates for your parameters, not sure for the error on your final prediction, if that's what you're after... I suppose you could use "population prediction intervals" for that if you like (by resampling parameters according to the fit following a multivariate normal distribution).
A: On a related note, which may be helpful, Tibshirani and colleagues have proposed a significance test for the lasso. The paper is available, and titled "A significance test for the lasso". A free version of the paper can be found here
A: Bayesian LASSO is the only alternative to the problem of calculating standard errors. Standard errors are automatically calculated in Bayesian LASSO...You can implement Bayesian LASSO very easily using Gibbs Sampling scheme...
Bayesian LASSO needs prior distributions to be assigned to the parameters of the model. In LASSO model, we have the objective function $||\mathbf{y}-\mathbf{X}\boldsymbol{\beta}||_2^2 + \lambda||\boldsymbol{\beta}||_1$ with $\lambda$ as the regularization parameter. Here as we have $\ell_1$-norm for $\boldsymbol{\beta}$ so, a special type of prior distribution is needed for this, LAPLACE distribution a scale mixture of normal distribution with exponential distribution as mixing density. Based upon the full conditional posteriors of each of the parameters are to be deduced.
Then one can use Gibbs Sampling for simulating the chain. See 
Park & Cassella (2008), "The Bayesian Lasso", JASA, 103, 482.
There are three inherent drawbacks of frequentist LASSO:


*

*One has to choose $\lambda$ by cross validation or other means.

*Standard errors are difficult to calculate as the LARS and other algorithms produce point estimates for $\boldsymbol{\beta}$.

*The hierarchical structure of the problem at hand cannot be encoded using frequentist model, which is quite easy in Bayesian framework.
A: To add to the answers above, the issue appears to be that even a bootstrap is likely insufficient as the estimate from the penalized model is biased and bootstrapping will only speak to the variance - ignoring the bias of the estimate. This is nicely summarized in the vignette for the penalized package on Page 18.
If being used for prediction however, why is a standard error from the model required? Can you not cross validate or bootstrap appropriately and produce a standard error around a metric related to prediction such as MSE?
