-
Notifications
You must be signed in to change notification settings - Fork 0
/
scenarios.R
34 lines (30 loc) · 1.37 KB
/
scenarios.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
sourceDir("datamakers")
scenarios=list()
# 4 simulation scenarios in Zou & Hastie (2005)
scenarios[[1]]=list(name="scenario(a)",fn=datamaker,
args=list(beta=c(3,1.5,0,0,2,0,0,0),
sigma=3,
Cov=0.5^abs(outer(1:8,1:8,FUN='-')),
nsamp.train=40,nsamp.test=200),
seed=1:50)
scenarios[[2]]=list(name="scenario(b)",fn=datamaker,
args=list(beta=rep(0.85,8),
sigma=3,
Cov=0.5^abs(outer(1:8,1:8,FUN='-')),
nsamp.train=40,nsamp.test=200),
seed=1:50)
scenarios[[3]]=list(name="scenario(c)",fn=datamaker,
args=list(beta=rep(c(0,2,0,2),each=10),
sigma=15,
Cov=0.5^abs(outer(1:40,1:40,FUN='-')),
nsamp.train=200,nsamp.test=400),
seed=1:50)
library(Matrix)
temp = matrix(rep(1,25),ncol=5)+0.01*diag(5)
Cov.4 = bdiag(temp,temp,temp,diag(25))
scenarios[[4]]=list(name="scenario(d)",fn=datamaker,
args=list(beta=c(rep(3,15),rep(0,25)),
sigma=15,
Cov=Cov.4,
nsamp.train=100,nsamp.test=400),
seed=1:50)