Calculates 2D entropy.
Arguments
- data
data.frame with two columns for x and y coordinates.
- bw
Bandwidth to use in 2D kernel density estimator.
- grid_size
Size of binning grid, in the unit of the data.
- relative
Logical. Rescale entropy relative to the maximum entropy given the number of grid cells? Defaults to FALSE.
- add_max
Logical. Add the maximum entropy as a return?
References
X. Liu, Q. Ma, X. Wu, T. Hu, Z. Liu, L. Liu, Q. Guo, Y. Su (2022). A novel entropy-based method to quantify forest canopy structural complexity from multiplatform lidar point clouds. Remote Sens. Environ. 282, 113280.
Examples
dta <- data.frame(x = rnorm(100,5,1), y = rnorm(100,5,1))
entropy_2d(dta, bw = 0.5, 0.25)
#> [1] 5.527666
entropy_2d(dta, bw = 0.5, 0.25, relative = TRUE)
#> [1] 0.8209322
dta <- data.frame(x = runif(100, 1,10), y = runif(100, 1,10))
entropy_2d(dta, bw = 0.5, 0.25)
#> [1] 7.334434
entropy_2d(dta, bw = 0.5, 0.25, relative = TRUE)
#> [1] 0.9720418