View source: R/estimate_variance.R
estimateVariance | R Documentation |
estimateVariance
estimate noise variance.
estimateVariance(X, Y, n_rep = 5)
X |
predictor matrix of dimension |
Y |
continuous outcome vector of length |
n_rep |
number of repeated estimation. Default is 10. |
The estimateSigma
function from selectiveInference is used repeatedly to estimate noise variance.
Estimated noise variance of X and Y.
Stephen Reid, Jerome Friedman, and Rob Tibshirani (2014). A study of error variance estimation in lasso regression. arXiv:1311.5274.
selectiveInference
## simulate some data
set.seed(9)
n = 30
p = 10
sigma.square = 1
X = matrix(rnorm(n*p),n,p)
beta = c(2,-2,1,-1,rep(0,p-4))
Y = X%*%beta + rnorm(n,0,sqrt(sigma.square))
## estimate sigma square
sigma.square.est = estimateVariance(X,Y)
sigma.square.est
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.