library(knitr) opts_chunk$set(echo=TRUE, fig.align='center', fig.width=4, fig.height=3, cache=TRUE, autodep=TRUE, cache.comments=FALSE, message=FALSE, warning=FALSE)
Generate data from a linear model. Let $X_{ij}$ and $\epsilon_i$ be iid standard Gaussian. Set $p=30$ and $n=100$. Set the first 5 $\beta_j = 1$ ($j=1,\ldots,5$), the rest are zero.
Fit LASSO to this data set. Calculate CV, AIC, and BIC. One can show that an unbiased estimator of the degrees of freedom is the number of selected covariates. Use the "unknown variance" version.
For each model selection crieterion, how many of the correct coefficients do you select? How many incorrect?
Repeat the same exercise but using $p=300$.
What do you notice?
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.