Performs simulated annealing or simulated tempering for a Gibbs point process model using a specified annealing schedule.
rtemper(model, invtemp, nrep, …, track=FALSE, start = NULL, verbose = FALSE)
A Gibbs point process model: a fitted Gibbs point process model
(object of class "ppm"
), or any data acceptable to
rmhmodel
.
A numeric vector of positive numbers. The sequence of values of inverse temperature that will be used.
An integer vector of the same length as invtemp
.
The value nrep[i]
specifies the number of steps of the
Metropolis-Hastings algorithm that will be performed
at inverse temperature invtemp[i]
.
Initial starting state for the simulation.
Any data acceptable to rmhstart
.
Logical flag indicating whether to save the transition history of the simulations.
Additional arguments passed to rmh.default
.
Logical value indicating whether to print progress reports.
A point pattern (object of class "ppp"
).
If track=TRUE
, the result also has an attribute
"history"
which is a data frame with columns
proposaltype
, accepted
,
numerator
and denominator
, as described
in rmh.default
.
The Metropolis-Hastings simulation algorithm
rmh
is run for
nrep[1]
steps at inverse temperature invtemp[1]
,
then for
nrep[2]
steps at inverse temperature invtemp[2]
,
and so on.
Setting the inverse temperature to a value
For example if the original model
is a Strauss process,
the modified model is close to a hard core process
for large values of inverse temperature, and close to a Poisson process
for small values of inverse temperature.
# NOT RUN {
stra <- rmhmodel(cif="strauss",
par=list(beta=2,gamma=0.2,r=0.7),
w=square(10))
nr <- if(interactive()) 1e5 else 1e4
Y <- rtemper(stra, c(1, 2, 4, 8), nr * (1:4), verbose=TRUE, track=TRUE)
# }
Run the code above in your browser using DataLab