Last chance! 50% off unlimited learning
Sale ends in
calcPottsParameter(Y, W_SR, coords = NULL, range = NULL, method = "MF", verbose = 3, ...)
rowSums(W_SR)=1
). REQUIRED.W_SR
is not specified, the coordinates of the sites used to compute the local neighbourhood matrix. data.frame.W_SR
is not specified, the range of the neighbourhood used to compute the local neighbourhood matrix. positive double."MF"
or "Lvfree"
.0
, 1
, 2
or 3
.calcPottsParameter
to perform the estimation. See the arguments of link{rhoMF}
or link{rhoLvfree}
.rhoMF
if argument method
is "MF"
or rhoLvfree
if argument method
is "Lvfree"
.
Estimation of the regional regularization parameter is only available with mean field approximation (method="MF"
).
The likelihood free estimation (Pereyra et al, 2013) should give a more accurate estimation despite a higher computational cost.
calcW
to compute the neighbourhood matrix,
simulPotts
to simulate from a Potts model.
# spatial field
## Not run:
# n <- 50
# ## End(Not run)
G <- 3
coords <- as.data.frame(which(matrix(0, nrow = n * G, ncol = n * G) == 0, arr.ind = TRUE))
# neighbourhood matrix
resW <- calcW(as.data.frame(coords), range = sqrt(2), row.norm = TRUE, calcBlockW = TRUE)
W_SR <- resW$W
site_order <- unlist(resW$blocks$ls_groups) - 1
# initialisation
set.seed(10)
sample <- simulPotts(W_SR, G = 3, rho = 3.5, iter_max = 500,
site_order = site_order)$simulation
#### estimation using the neighbourhood matrix
rho_MF <- calcPottsParameter(Y = sample, W_SR = W_SR, method = "MF")
## Not run:
# rho_Lvfree <- calcPottsParameter(Y = sample, W_SR = W_SR,
# site_order = site_order, method = "Lvfree", verbose = 2)
# ## End(Not run)
#### estimation using the coordinates
rho_MF <- calcPottsParameter(Y = sample, coords = coords, range = sqrt(2), method = "MF")
## Not run:
# rho_Lvfree <- calcPottsParameter(Y = sample, coords = coords, range = sqrt(2),
# site_order = site_order, method = "Lvfree", verbose = 2)
# ## End(Not run)
Run the code above in your browser using DataLab