simulation.collinear: Simulation studies for Lasso, Elastic Net and ridge

Description Usage Arguments Value Details Author(s) Examples

View source: R/predictionsimulation.R

Description

This function calls the data generating function simulation.generation.data and can be used to conduct simulation studies for comparison between the Lasso, the Elastic Net and the ridge regression.

Usage

1
2
3
4
simulation.collinear(n.resample = n.resample, n = n, coeff = coeff,
  matrix.option = 2, collinear = collinear, sig = sig,
  split.prop = split.prop, step.alpha = step.alpha, option = 1,
  parallel = FALSE)

Arguments

n.resample

The number of simulation datasets to generate

n

The number of rows in the each data.frame

coeff

A vector a true coefficients fixed acrossed the simulated datasets

matrix.option

1: Using an Exchangeable correlation matrix to simulate the predictors
2: Using an Autoregressive correlation matrix to simulate the predictors

collinear

The correlation levels within the matrix.option

sig

The model inherent error, the σ^2

split.prop

An element specifying the training proportion. Note the testing proportion will be 1 - the training proportion.

step.alpha

The step size of the alpha grid for the Elastic Net.

option

1: split the dataset according to c(split.prop, 1 - split.prop)
2: Use the whole dataset. Note When option = 2, the split.prop will be ignored
Note: When using simulation.collinear please make sure "option = 1" under the current package.

parallel

Parallelisation

Value

A list of elements:

final.table

A summary table contains: 1.The averaged external simulation prediction error for Lasso, Elastic Net and the Ridge
2.The standard error of the prediction error by using bootstrapping
3.The proportion of times the each method correctly chooses the true model
4.The averaged α: 1 for Lasso, averaged simluated α for the Elastic Net and 0 for the Ridge

lasso.result

A matrix full with simulation results for the Lasso method. Users can freely use this result matrix to obtain further insight

EN.result

A matrix full with simualtion results for the Elastic Net method. Users can freely use this result matrix to obtain further insight

ridge.result

A matrix full with simulation results for the ridge regression. Users can freely use this result matrix to botain further isnight

Details

The function is one of the core function for the simulation studies. The function supports comparison between the Lasso, the Elastic Net and the ridge regression. This function calls the function simulation.generation.data and thus, users can study different datasets of their liking. The function provide a summary table for the simulation results. The matrices containing the simulation iterations for the three methods are also provided. Therefore, users are free to conduct further investigation.

Author(s)

Mokyo Zhou

Examples

1
2
3
4
5
6
7
#number of simulated dataset 20, 200 rows, vector of true coefficient is c(10,8,0,0,12,0,0,0,0,0),
#using autoregressive correlation matrix, correlation level is 0.2 in the autoregressive matrix,
#model error is 3, training proportion is 0.6, step size of the alpha grid is 0.2, splitting
#the dataset into a training and a testing set. No parallelisation.
simulation1 <- simulation.collinear(n.resample = 20, n = 200, coeff = c(10,8,0,0,12,0,0,0,0,0),
matrix.option = 2, collinear = 0.2, sig = 3,split.prop = 0.6, parallel = FALSE, step.alpha = 0.2,
option= 1)

MokyoZhou/lassoenet documentation built on May 20, 2019, 11:38 a.m.