elasticNetSim: A blocked correlated data simulation.

Description Usage Arguments Value References Examples

Description

Creates a data simulation of n observations with signal groups of (p0/signal) signal variables and (p-p0) noise variables. Random noise is added to all columns. The default values, with n=100 create the simulation of Zou and Hastie (2005).

Usage

1
2
elasticNetSim(n, p = 40, p0 = 15, signal = 3, sigma = sqrt(0.01),
  beta.true = NULL)

Arguments

n

number of observations

p

number of coordinate directions in the design matrix (default 40)

p0

number of signal coordinate directions in the design matrix (default 15)

signal

number of signal groups (default 3)

sigma

within group correlation coefficient (default sqrt(0.01))

beta.true

specify the true simulation parameters. (default NULL = generated from other arguments)

Value

list of

References

Zou, H. and Hastie, T. (2005) Regularization and variable selection via the elastic net J. R. Statist. Soc. B, 67, Part 2, pp. 301-320

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#--------------------------------------------------------------------------
# Example: Elastic net simulation
#  
# For elastic net simulation data, see Zou, H. and Hastie, T. (2005) 
# Regularization and variable selection via the elastic net J. R. Statist. Soc. B
# , 67, Part 2, pp. 301-320
  # Set the RNG seed to create a reproducible simulation
  set.seed(432) # Takes an integer argument
  
  # Creata simulation with 100 observations.
  dta <- elasticNetSim(n=100)
  
  # The simulation contains a design matrix x, and response vector y
  dim(dta$x)
  length(dta$y)
  print(dta$x[1:5,])

ehrlinger/l2boost documentation built on May 16, 2019, 1:20 a.m.