Nothing
test_that("spGini decomposition components sum to the global Gini", {
set.seed(1)
d <- random.test.data(nrows = 5, ncols = 5)
Coords <- cbind(d$X + runif(25)/10, d$Y + runif(25)/10)
g <- spGini(Coords, 4, d$dep, WType = "Binary")
g <- unlist(g)
expect_equal(unname(g[1]), unname(g[2] + g[3]), tolerance = 1e-10)
expect_true(g[1] >= 0 && g[1] <= 1)
})
test_that("spGini.w matches spGini for the same binary weights", {
set.seed(2)
d <- random.test.data(nrows = 5, ncols = 5)
Coords <- cbind(d$X + runif(25)/10, d$Y + runif(25)/10)
g <- unlist(spGini(Coords, 4, d$dep, WType = "Binary"))
# spGini's adaptive kernel includes the observation itself,
# so bandwidth bw corresponds to bw-1 nearest neighbours in w.matrix
w <- w.matrix(Coords, 3, WType = "Binary", family = "adaptive")
g.w <- spGini.w(d$dep, w)
expect_equal(unname(g[1:3]), unname(g.w[1:3]), tolerance = 1e-10)
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.