input data may be a matrix, a Spatial Grid Data Frame, a RasterLayer or a list of these objects. In the latter case, only the first element of the list will be considered.
window
the side of the square moving window, it must be a odd numeric value greater than 1 to ensure that the target pixel is in the center of the moving window. Default value is 3.
np
the number of processes (cores) which will be spawned. Default value is 1.
na.tolerance
a numeric value \((0.0-1.0)\) which indicates the proportion of NA values that will be tolerated to calculate Rao's index in each moving window over x. If the relative proportion of NA's in a moving window is bigger than na.tolerance, then the value of the window will be set as NA, otherwise Rao's index will be calculated considering the non-NA values. Default values is 0.0 (i.e., no tolerance for NA's).
cluster.type
the type of cluster which will be created. The options are "MPI" (calls "makeMPIcluster"), "FORK" and "SOCK" (call "makeCluster"). Default type is "SOCK".
debugging
a boolean variable set to FALSE by default. If TRUE, additional messages will be printed. For debugging only.
Value
A numerical matrix with dimension {dim(x)}.
Details
Shannon's index (\(H'\)) is calculated on a numerical matrix as \(H' = {\sum_{i=1}^{R} p_i \times log(p_i)}\), where R is the total number of categories (i.e., unique numerical values in the considered numerical matrix) and p is the relative abundance of each category.
References
Shannon, C.E. (1948). A mathematical theory of communication. Bell System Technical Journal, 27: 379-423, 623-656.