inf_2D_image {sim2Dpredictr} | R Documentation |
Display Inference Results for 2D Predictors
Description
Provide graphics for spatial extent of predictor parameters, rejections and/or the truth/falsity of the rejections.
Usage
inf_2D_image(
rejections = NULL,
B = NULL,
im.res,
test.statistic = NULL,
reject.threshold = NULL,
binarize.B = TRUE,
grid.color = "grey",
n.colors = length(unique(B)),
B.incl.B0 = TRUE,
plot.title = TRUE,
manual.title = NULL,
title.size = 1
)
Arguments
rejections |
A binary vector; |
B |
A vector of "true" parameter values. For inference purposes, this can be a vector of actual parameter values, or a binary vector indicating non-zero status. |
im.res |
A vector defining the dimension of spatial data. The first entry is the number of rows and the second entry is the number of columns. |
test.statistic |
A vector of test statistics; e.g., t-statistics or p-values that are used to determine whether or not to reject the null hypothesis. |
reject.threshold |
A list whose first element is the rejection
criteria, e.g., the minimum t-statistic or maximum p-value for which to
reject the null hypothesis. The second element is one of
|
binarize.B |
Either |
grid.color |
Specify the color for the grid lines. |
n.colors |
Determines the number of colors in the printed image.
Default is |
B.incl.B0 |
If |
plot.title |
When |
manual.title |
When |
title.size |
Specifies the size of the title text. This is based on
|
Value
An image depicting the spatial extent of some image characteristic.
Note
If both rejections
and B
are specified then the
function provides an image with separate color each for:
No rejection and
B[i] = 0
(i.e. True Negative).No rejection and
B[i] != 0
(i.e. False Negative).Rejection and
B[i] = 0
(i.e. False Positive).Rejection and
B[i] != 0
(i.e. True Positive).
Examples
## 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))