## examples
correlation_builder(corr.structure = "ar1", im.res = c(3, 3), rho = 0.5,
neighborhood = "round", r = 6, print.all = TRUE)
correlation_builder(corr.structure = "exponential", im.res = c(3, 3),
phi = 0.5,
neighborhood = "round", r = 3, print.all = TRUE)
correlation_builder(corr.structure = "CS", im.res = c(3, 3),
rho = 0.5, print.all = TRUE)
## no "true" zeros, but gets close
c.nr <- correlation_builder(corr.structure = "ar1", neighborhood = "none",
corr.min = NULL, im.res = c(15, 15), rho = 0.5)
length(c.nr[c.nr > 0])
min(c.nr)
## set corr.min gives many zero entries; sparser structure
c.r <- correlation_builder(corr.structure = "ar1", neighborhood = "none",
corr.min = 0.01, im.res = c(15, 15), rho = 0.5)
## raw number > 0
length(c.r[c.r > 0])
## proportion > 0
length(c.r[c.r > 0]) / length(c.nr)
Run the code above in your browser using DataLab