corr_fun {sim2Dpredictr} | R Documentation |
Specify the Correlation Function between Two Locations
Description
This is primarily for use within correlation builder, and may be altered/expanded to handle more complicated correlation functions if desired.
Usage
corr_fun(
corr.structure,
im.res,
corr.min = NULL,
rho = NULL,
phi = NULL,
neighborhood = "none",
round.d = FALSE,
w = NULL,
h = NULL,
r = NULL,
i,
j,
k,
v
)
Arguments
corr.structure |
One of |
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. |
corr.min |
Scalar value to specify the minimum non-zero correlation.
Any correlations below |
rho |
This is the maximum possible correlation between locations i and
j. For all i,j |
phi |
A scalar value greater than 0 that determines the decay of
correlation. This argument is only utilized when |
neighborhood |
Defines the neighborhood within which marginal
correlations are non-zero. The default is |
round.d |
If |
w , h |
If |
r |
If |
i , j , k , v |
These are the coordinates for the two locations. Location 1 has coordinates (i, j) and location 2 has coordinates (k, v). |
Value
A single element vector containing the correlation between spatial locations with indices (i, j) and (k, v).
Examples
## examples
corr_fun(corr.structure = "ar1", im.res = c(3, 3), rho = 0.5,
neighborhood = "round", r = 6, i = 1, j = 2, k = 2, v = 3)
corr_fun(corr.structure = "ar1", im.res = c(3, 3), rho = 0.5,
neighborhood = "rectangle", w = 1, h = 1,
i = 1, j = 2, k = 2, v = 3)