Description Usage Arguments Value Details Author(s) Examples
View source: R/predictionsimulation.R
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.
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)
|
n.resample |
The number of simulation datasets to generate |
n |
The number of rows in the each |
coeff |
A vector a true coefficients fixed acrossed the simulated datasets |
matrix.option |
1: Using an Exchangeable correlation matrix to simulate the predictors |
collinear |
The correlation levels within the |
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 |
parallel |
Parallelisation |
A list of elements:
final.table |
A summary table contains:
1.The averaged external simulation prediction error for Lasso, Elastic Net and 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 |
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.
Mokyo Zhou
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.