Test of the functions gridpts, h1, hupdate
Source:vignettes/check_gridpts_h1_hupdate.Rmd
check_gridpts_h1_hupdate.Rmd
Tests of gridpts
default (N(0,1))
approximate variance of standard normal (i.e., 1)
x1 <- gridpts_(mu = 0, a = -20, b = 20, r = 18)
x2 <- gridpts(mu = 0, a = -20, b = 20, r = 18)
x3a <- gsDesign::normalGrid(bounds = c(-10, 10), mu = 0, sigma = 1, r = 18)
x3b <- gsDesign::normalGrid(bounds = c(-20, 20), mu = 0, sigma = 1, r = 18)
x3c <- gsDesign::normalGrid(bounds = c(-80, 80), mu = 0, sigma = 1, r = 18)
Number of grid points | ||||
Rcpp | R | C with (a, b) = (-10, 10) | C with (a, b) = (-20, 20) | C with (a, b) = (-80, 80) |
---|---|---|---|---|
213 | 213 | 205 | 213 | 213 |
Difference between Rcpp and R | |
in gsdmvn | |
diff_z | diff_w |
---|---|
0 | 0 |
Difference between gsDesign (C) and gsdmvn (Rcpp) | |
under (a, b) = (-10, 10) | |
diff_z | diff_w |
---|---|
243.1551 | 10.23437 |
Difference between gsDesign and gsdmvn | |
under (a, b) = (-20, 20) | |
diff_z | diff_w |
---|---|
1.648681e-14 | 1.571313e-14 |
Difference between gsDesign and gsdmvn | |
under (a, b) = (-80, 80) | |
diff_z | diff_w |
---|---|
1.648681e-14 | 1.571313e-14 |
approximate probability of N(0,1) above .95 quantile (i.e., .05)
x1 <- gridpts_(mu = 0, a = qnorm(0.95), b = Inf, r = 18)
x2 <- gridpts(mu = 0, a = qnorm(0.95), b = Inf, r = 18)
x3a <- gsDesign::normalGrid(bounds = c(qnorm(0.95), 10), mu = 0, sigma = 1, r = 18)
x3b <- gsDesign::normalGrid(bounds = c(qnorm(0.95), 20), mu = 0, sigma = 1, r = 18)
x3c <- gsDesign::normalGrid(bounds = c(qnorm(0.95), 80), mu = 0, sigma = 1, r = 18)
Number of grid points | ||||
Rcpp | R | C with (a, b) = (-10, 10) | C with (a, b) = (-20, 20) | C with (a, b) = (-80, 80) |
---|---|---|---|---|
69 | 69 | 65 | 69 | 80 |
Difference between Rcpp and R | |
in gsdmvn | |
diff_z | diff_w |
---|---|
0 | 0 |
Difference between gsDesign (C) and gsdmvn (Rcpp) | |
under (a, b) = (-10, 10) | |
diff_z | diff_w |
---|---|
44.07849 | 4.47023 |
Difference between gsDesign and gsdmvn | |
under (a, b) = (-20, 20) | |
diff_z | diff_w |
---|---|
3.552714e-15 | 3.338042e-15 |
Difference between gsDesign and gsdmvn | |
under (a, b) = (-80, 80) | |
diff_z | diff_w |
---|---|
3.552714e-15 | 3.338042e-15 |
approximate probability of N(0.5, 1) above .95 quantile (i.e., .05)
x1 <- gridpts_(mu = 0.5, a = qnorm(0.95), b = Inf, r = 18)
x2 <- gridpts(mu = 0.5, a = qnorm(0.95), b = Inf, r = 18)
x3a <- gsDesign::normalGrid(bounds = c(qnorm(0.95), 10), mu = 0.5, sigma = 1, r = 18)
x3b <- gsDesign::normalGrid(bounds = c(qnorm(0.95), 20), mu = 0.5, sigma = 1, r = 18)
x3c <- gsDesign::normalGrid(bounds = c(qnorm(0.95), 80), mu = 0.5, sigma = 1, r = 18)
Number of grid points | ||||
Rcpp | R | C with (a, b) = (-10, 10) | C with (a, b) = (-20, 20) | C with (a, b) = (-80, 80) |
---|---|---|---|---|
81 | 81 | 77 | 81 | 81 |
Difference between Rcpp and R | |
in gsdmvn | |
diff_z | diff_w |
---|---|
1.776357e-15 | 1.484923e-15 |
Difference between gsDesign (C) and gsdmvn (Rcpp) | |
under (a, b) = (-10, 10) | |
diff_z | diff_w |
---|---|
46.82849 | 4.97023 |
Difference between gsDesign and gsdmvn | |
under (a, b) = (-20, 20) | |
diff_z | diff_w |
---|---|
6.661338e-15 | 5.25361e-15 |
Difference between gsDesign and gsdmvn | |
under (a, b) = (-80, 80) | |
diff_z | diff_w |
---|---|
6.661338e-15 | 5.25361e-15 |