## parameter vector
Bex <- beta_builder(row.index = c(rep(5, 3), rep(6, 3), rep(7, 3)),
col.index = rep(c(5, 6, 7), 3),
im.res = c(10, 10), index.type = "manual",
B0 = 0, B.values = 1:9,
output.indices = FALSE)
## co-opt beta builder to get rejections
rejex <- beta_builder(row.index = c(rep(4, 3), rep(5, 3), rep(6, 3)),
col.index = rep(c(4, 5, 6), 3),
im.res = c(10, 10), index.type = "manual",
B0 = 0, B.values = rep(1, 9),
output.indices = FALSE)[-1]
rejex.sm2 <- beta_builder(row.index = 5:6, col.index = 5:6,
im.res = c(10, 10),
B0 = 0, B.values = 1,
output.indices = FALSE)[-1]
## just B
inf_2D_image(B = Bex, im.res = c(10, 10))
## just rejections
inf_2D_image(rejections = rejex, im.res = c(10, 10))
## both B and rejections
inf_2D_image(rejections = rejex, B = Bex, im.res = c(10, 10))
inf_2D_image(rejections = rejex.sm2, B = Bex, im.res = c(10, 10))
## larger dimension example
Bex2 <- beta_builder(row.index = 5:15, col.index = 16:20,
im.res = c(50, 50), B0 = 0,
B.values = 1:(length(5:15) * length(16:20)),
index.type = "rectangle",
output.indices = FALSE)
rejex2 <- beta_builder(row.index = 13:21, col.index = 30:41,
im.res = c(50, 50), B0 = 0,
B.values = rep(1, (length(13:21) * length(30:41))),
index.type = "rectangle",
output.indices = FALSE)[-1]
rejex3 <- beta_builder(row.index = 5:20, col.index = 16:30,
im.res = c(50, 50), B0 = 0,
B.values = rep(1, (length(5:20) * length(16:30))),
index.type = "rectangle",
output.indices = FALSE)[-1]
rejex4 <- beta_builder(row.index = 5:10, col.index = 16:17,
im.res = c(50, 50), B0 = 0,
B.values = rep(1, (length(5:10) * length(16:17))),
index.type = "rectangle",
output.indices = FALSE)[-1]
## images
inf_2D_image(B = Bex2, im.res = c(50, 50))
inf_2D_image(B = Bex2, im.res = c(50, 50), binarize.B = FALSE)
inf_2D_image(rejections = rejex2, im.res = c(50, 50))
## No TP
inf_2D_image(rejections = rejex2, B = Bex2, im.res = c(50, 50))
## ALL TP
inf_2D_image(rejections = Bex2[-1], B = Bex2, im.res = c(50, 50))
## No FN
inf_2D_image(rejections = rejex3, B = Bex2, im.res = c(50, 50))
## No FP, but FN
inf_2D_image(rejections = rejex4, im.res = c(50, 50))
inf_2D_image(B = Bex2, im.res = c(50, 50))
inf_2D_image(rejections = rejex4, B = Bex2, im.res = c(50, 50))
Run the code above in your browser using DataLab