Performs simulations based on the given parameters of the Ising model
kinetic_ising(
x,
B,
J,
updates = 1,
iter,
rule = "glauber",
inertia = 0,
version = 1,
progress = FALSE,
external_field = NULL
)SpatRaster or matrix containing two values: -1 and 1. NA cells are
excluded from the simulation.
External pressure (positive or negative): it tries to align cells' values with its sign
Strength of the local autocorrelation tendency (always positive): it tries to align signs of neighboring cells
Specifies how many sets of iterations are performed on the input object.
The output of this function has as many layers as the updates value.
Specifies how many iterations are performed on the input object. By default it equals to the number of values in the input object.
IM temporal evolution rule: either "glauber" (default) or "metropolis"
Represents the modification of the algorithm aimed at suppressing the salt-and-pepper noise of the focus category present when simulating evolution of a coarse-textured pattern. With Q > 0, small patches of the focus category are not generated, thus eliminating the salt-and-pepper noise of the focus category
By default, 1, the x object is converted into a matrix
(fast, but can be memory consuming); version = 2 has a lower RAM impact, but
is much slower
TRUE/FALSE
Optional spatial adjustment added to B at each cell.
Values are on the same pressure scale as B: positive values favor 1,
negative values favor -1, and zero has no effect. The field
must be a matrix with the same dimensions as a matrix x, or a single-layer
SpatRaster with the same geometry as a raster x. Values may be NA only
where x is NA.
Object of the same class as x with the number of layers specified by updates
To derive external_field from a probability map p, first convert the
probabilities to local pressure using
external_field = 0.5 * log(p / (1 - p)) - B.
Exact probabilities of zero and one produce infinite pressure and therefore
act as hard constraints. To keep the pressure finite, clip estimated
probabilities before conversion. For a matrix, use
p = pmin(pmax(p, eps), 1 - eps); for a SpatRaster, use
p = terra::clamp(p, eps, 1 - eps). Smaller values of eps represent
stronger classifier evidence.
Ising, E., 1924. Beitrag zur theorie des ferro-und paramagnetismus. Ph.D. thesis, Grefe & Tiedemann.
Onsager, L., 1944. Crystal statistics. I. A two-dimensional model with an order-disorder transition. Physical Review 65 (3-4), 117.
Brush, S. G., 1967. History of the Lenz-Ising model. Reviews of modern physics 39 (4), 883.
Cipra, B. A., 1987. An introduction to the Ising model. The American Mathematical Monthly 94 (10), 937–959.
data(r_start, package = "spatialising")
ts1 = kinetic_ising(r_start, B = -0.3, J = 0.7)
ts10 = kinetic_ising(r_start, B = -0.3, J = 0.7, updates = 10)
# \donttest{
r1 = terra::rast(system.file("raster/r_start.tif", package = "spatialising"))
terra::plot(r1)
r2 = kinetic_ising(r1, B = -0.3, J = 0.7)
terra::plot(r2)
library(terra)
ri1 = kinetic_ising(r1, B = -0.3, J = 0.7, updates = 9)
plot(ri1)
ri2 = kinetic_ising(r1, B = 0.3, J = 0.7, updates = 9)
plot(ri2)
ri3 = kinetic_ising(r1, B = -0.3, J = 0.4, updates = 9)
plot(ri3)
# }