View source: R/ssim_bandwidth.R
| ssim_bandwidth | R Documentation |
Computes bias–variance trade-off curves for two polygon maps using an adaptive Gaussian kernel. The two input variables can be optionally transformed (e.g. normal scores or min–max normalisation) before smoothing. A suggested bandwidth range is obtained by balancing standardized bias and variance for each variable, and a single bandwidth is chosen from this range.
ssim_bandwidth(
shape,
map1,
map2,
max_bandwidth,
transform = c("normal_score", "percentile", "none", "minmax"),
option = "midpoint"
)
shape |
An |
map1 |
Character string; column name in |
map2 |
Character string; column name in |
max_bandwidth |
Integer (at least 12). Upper bound of the bandwidth
|
transform |
One of |
option |
Character string specifying how to choose a single bandwidth
from the bias–variance trade-off range: one of
|
This function does *not* compute SSIM; it is intended to be used in
combination with ssim_polygon(), which can then be called with the
selected bandwidth.
The kernel is Gaussian with adaptive bandwidth:
w_{ij} = \exp\left\{-\tfrac12 (d_{ij} / h_i)^2 \right\},
where d_{ij} is the distance between polygon centroids and
h_i is the distance from polygon i to its k-th nearest
neighbour. Bandwidth selection is based purely on bias–variance trade-off
and does not involve any SSIM computation or permutation testing.
A list with components:
plot |
A |
bandwidth |
The chosen bandwidth |
tradeoff |
A list with elements
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.