Last chance! 50% off unlimited learning
Sale ends in
rhoMF(Y, W_SR, rho_max = 50, prior_prevalence = TRUE, test.regional = FALSE, W_LR, distance.ref, coords, threshold = 0.1,
nbGroup_min = 100, regionalGroups = "last_vs_others", multiV = TRUE)
dgCMatrix
. Should be normalized by row (i.e. rowSums(Wweight_SR)=1
). REQUIRED.W_LR
. numeric vector."last_vs_others"
) or for each group ("each"
).calcW
to compute the neighbourhood matrix,
simulPotts
to draw simulations from a Potts model.
rhoLvfree
to estimate the regularization parameters using mean field approximation.
calcPottsParameter
general interface for estimating the regularization parameters.
# spatial field
## Not run:
# n <- 50
# ## End(Not run)
G <- 3
coords <- which(matrix(0, nrow = n * G, ncol = n * G) == 0,arr.ind = TRUE)
# neighbourhood matrix
W_SR <- calcW(as.data.frame(coords), range = sqrt(2), row.norm = TRUE)$W
W_LR <- calcW(as.data.frame(coords), range = 10, row.norm = FALSE)$W
# initialisation
set.seed(10)
sample <- simulPotts(W_SR, G = 3, rho = 3.5, iter_max = 500,
site_order = TRUE)$simulation
multiplot(as.data.frame(coords), sample,palette = "rgb")
# estimation
rho <- rhoMF(Y=sample, W_SR = W_SR)
rho
# the regional potential is computed for each group
rho <- rhoMF(Y = sample, W_SR = W_SR,
test.regional = TRUE, W_LR = W_LR, distance.ref = seq(1, 10, 0.5),
coords = coords, regionalGroups = "each")
rho
# the regional potential is computed for the last group vs. the others
rho <- rhoMF(Y = sample, W_SR = W_SR,
test.regional = TRUE, W_LR = W_LR, distance.ref = seq(1, 10, 0.5),
coords = coords, regionalGroups = "last_vs_others")
rho
Run the code above in your browser using DataLab