estimateVariance: Estimate noise variance given predictor X and response Y.

Description Usage Arguments Details References See Also Examples

Description

estimateVariance estimate noise variance.

Usage

1
estimateVariance(X, Y, n_rep = 5)

Arguments

X

predictor matrix of dimension n by p.

Y

continuous outcome vector of length n.

n_rep

number of repeated estimation. Default is 10.

Details

The estimateSigma function from selectiveInference is used repeatedly to estimate noise variance.

References

Stephen Reid, Jerome Friedman, and Rob Tibshirani (2014). A study of error variance estimation in lasso regression. arXiv:1311.5274.

See Also

selectiveInference

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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

ChubingZeng/classo documentation built on June 4, 2019, 12:37 p.m.