-
Notifications
You must be signed in to change notification settings - Fork 27
/
benchmark.R
99 lines (83 loc) · 3.8 KB
/
benchmark.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
if (!require('glmnet')) install.packages('glmnet')
if (!require('picasso')) install.packages('picasso')
if (!require('ncvreg')) install.packages('ncvreg')
if (!require('scalreg')) install.packages('scalreg')
if (!require('flare')) install.packages('flare')
library(glmnet)
library(picasso)
library(ncvreg)
library(scalreg)
library(flare)
source("test_picasso.R")
cat("\n-----------------------------------------------------------\n")
cat("\n-----------------------------------------------------------\n")
cat("-------Testing Linear Regression with L1 Penalty------\n")
cat("------Comparisions of estimation errors.------\n")
cat("-----------------------\n")
cat("---------n=500, p=5000, c=0.25---------\n")
test_elnet(n=500, p=5000, c=0.25)
cat("-----------------------\n")
cat("---------n=1000, p=10000, c=0.25---------\n")
test_elnet(n=1000, p=10000, c=0.25)
cat("---------n=500, p=5000, c=0.75---------\n")
test_elnet(n=500, p=5000, c=0.75)
cat("-----------------------\n")
cat("---------n=1000, p=10000, c=0.75---------\n")
test_elnet(n=1000, p=10000, c=0.75)
cat("\n-----------------------------------------------------------\n")
cat("\n-----------------------------------------------------------\n")
cat("-------Testing Linear Regression with SCAD/MCP Penalty------\n")
cat("-----------------------\n")
cat("---------n=500, p=5000, c=0.25---------\n")
test_elnet_nonlinear(n=500, p=5000, c=0.25, penalty='scad')
cat("-----------------------\n")
cat("---------n=1000, p=10000, c=0.25---------\n")
test_elnet_nonlinear(n=1000, p=10000, c=0.25, penalty='scad')
cat("---------n=500, p=5000, c=0.75---------\n")
test_elnet_nonlinear(n=500, p=5000, c=0.75, penalty='scad')
cat("-----------------------\n")
cat("---------n=1000, p=10000, c=0.75---------\n")
test_elnet_nonlinear(n=1000, p=10000, c=0.75, penalty='scad')
cat("\n-----------------------------------------------------------\n")
cat("\n-----------------------------------------------------------\n")
cat("-------Testing Logistic Regression with L1 Penalty------\n")
cat("------Comparisions of estimation errors.------\n")
cat("-----------------------\n")
cat("---------n=500, p=2000, c=0.25---------\n")
test_lognet(n=500, p=2000, c=0.25)
cat("-----------------------\n")
cat("---------n=1000, p=5000, c=0.25---------\n")
test_lognet(n=1000, p=5000, c=0.25)
cat("---------n=500, p=2000, c=0.75---------\n")
test_lognet(n=500, p=2000, c=0.75)
cat("-----------------------\n")
cat("---------n=1000, p=5000, c=0.75---------\n")
test_lognet(n=1000, p=5000, c=0.75)
cat("\n-----------------------------------------------------------\n")
cat("\n-----------------------------------------------------------\n")
cat("-------Testing Logistic Regression with SCAD/MCP Penalty------\n")
cat("-----------------------\n")
cat("---------n=500, p=2000, c=0.25---------\n")
test_lognet_nonlinear(n=500, p =200, c=0.25, penalty='scad')
cat("-----------------------\n")
cat("---------n=1000, p=5000, c=0.25---------\n")
test_lognet_nonlinear(n=1000, p =500, c=0.25, penalty='scad')
cat("-----------------------\n")
cat("---------n=500, p=2000, c=0.75---------\n")
test_lognet_nonlinear(n=500, p =200, c=0.75, penalty='scad')
cat("-----------------------\n")
cat("---------n=1000, p=5000, c=0.75---------\n")
test_lognet_nonlinear(n=1000, p =500, c=0.75, penalty='scad')
cat("\n-----------------------------------------------------------\n")
cat("-------Testing Square Root Lasso------\n")
cat("-----------------------\n")
cat("---------n=200, p=1000, c=0.25---------\n")
test_sqrt_mse(n=200, p =1000, c=0.25)
cat("-----------------------\n")
cat("---------n=500, p=2000, c=0.25---------\n")
test_sqrt_mse(n=500, p =2000, c=0.25)
cat("-----------------------\n")
cat("---------n=200, p=1000, c=0.75---------\n")
test_sqrt_mse(n=200, p =1000, c=0.75)
cat("---------n=500, p=2000, c=0.75---------\n")
test_sqrt_mse(n=500, p =2000, c=0.75)