lambda_Select: Select Lambda using Dr Zhou's approach

Description Usage Arguments Value Examples

Description

Select Lambda using Dr Zhou's approach

Usage

1
2
lambda_Select(Yvec, Xmat, lambdas = seq(from = 0.001, to = 1, length.out =
  50), nPsep = 20, perc = 0.2,iidSampletype = "rnorm", ...)

Arguments

Yvec

Y vector(n)

Xmat

Design Matrix(n by p)

lambdas

Proposed lambda, default value is seq(from=.001,to=1,length.out=50)

nPsep

Number of independent simulation data.

perc

Stopping percentage

iidSampletype

Random number generator. It could be any R random number generator which 1 accpet only sample size as parameter,2 should be vectorized.

Value

result Result from glmnet

selection T/F of lambdas. F means

Examples

1
2
3
4
5
6
7
8
set.seed(65535)
Xmat = matrix(rnorm(100*80),ncol=80)
beta0 = rnorm(80,sd=2)
beta0[sample(1:80,70)] = 0.
epsilon = rnorm(100)
Yvec = Xmat%*%beta0 + epsilon
lambdas = seq(from=.001,to=1,length.out=50) # a vec
lambda_Select(Yvec,Xmat)

yfyang86/optimise2 documentation built on May 4, 2019, 2:32 p.m.