-
Notifications
You must be signed in to change notification settings - Fork 0
/
time_requirements.R
68 lines (60 loc) · 1.39 KB
/
time_requirements.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
times = sapply(1:20, function(n) {
t = mean(replicate(10, {
ptm <- proc.time()
adjust_alpha_optimize(.05, n*50)
t = proc.time() - ptm
t[["elapsed"]]
}))
cat("N:", 50 * n, "t:", t, "\n")
t
})
times_2chains = sapply(1:4, function(n) {
t = mean(replicate(10, {
ptm <- proc.time()
adjust_alpha_optimize_chains(.05, n*50, nchains = 2)
t = proc.time() - ptm
t[["elapsed"]]
}))
cat("N:", 50 * n, "t:", t, "\n")
t
})
times_4chains = sapply(1:4, function(n) {
t = mean(replicate(10, {
ptm <- proc.time()
adjust_alpha_optimize_chains(.05, N=n*10, nchains = 4)
t = proc.time() - ptm
t[["elapsed"]]
}))
cat("N:", 10 * n, "t:", t, "\n")
t
})
times_sim = sapply(1:10, function(n) {
t = mean(replicate(10, {
ptm <- proc.time()
adjust_alpha_simulate(.05, n*100)
t = proc.time() - ptm
t[["elapsed"]]
}))
cat("N:", 50 * n, "t:", t, "\n")
t
})
times_2chains_sim = sapply(1:10, function(n) {
t = mean(replicate(10, {
ptm <- proc.time()
adjust_alpha_simulate_chains(.05, n*100, nchains = 2)
t = proc.time() - ptm
t[["elapsed"]]
}))
cat("N:", 50 * n, "t:", t, "\n")
t
})
times_4chains_sim = sapply(1:10, function(n) {
t = mean(replicate(10, {
ptm <- proc.time()
adjust_alpha_simulate_chains(.05, n*100, nchains = 4)
t = proc.time() - ptm
t[["elapsed"]]
}))
cat("N:", 50 * n, "t:", t, "\n")
t
})