estimateVariance {xtune} | R Documentation |
Estimate noise variance given predictor X and continuous outcome Y.
Description
estimateVariance
estimate noise variance.
Usage
estimateVariance(X, Y, n_rep = 5)
Arguments
X |
predictor matrix of dimension |
Y |
continuous outcome vector of length |
n_rep |
number of repeated estimation. Default is 10. |
Details
The estimateSigma
function from selectiveInference is used repeatedly to estimate noise variance.
Value
Estimated noise variance of X and Y.
References
Stephen Reid, Jerome Friedman, and Rob Tibshirani (2014). A study of error variance estimation in lasso regression. arXiv:1311.5274.
See Also
Examples
## 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
[Package xtune version 2.0.0 Index]