| simulate.ppm | R Documentation |
Generates simulated realisations from a fitted Gibbs or Poisson point process model.
## S3 method for class 'ppm'
simulate(object, nsim=1, ...,
singlerun = FALSE,
start = NULL,
control = default.rmhcontrol(object, w=w),
w = window,
window = NULL,
project=TRUE, new.coef=NULL, newdata=NULL,
verbose=FALSE, progress=(nsim > 1),
drop=FALSE)
object |
Fitted point process model.
An object of class |
nsim |
Number of simulated realisations. |
singlerun |
Logical. Whether to generate the simulated realisations
from a single long run of the Metropolis-Hastings algorithm
( |
start |
Data determining the initial state
of the Metropolis-Hastings algorithm. See
|
control |
Data controlling the running of
the Metropolis-Hastings algorithm. See |
w, window |
Optional. The window in which the model should be simulated.
An object of class |
... |
Further arguments passed to |
project |
Logical flag indicating what to do if the fitted model is
invalid (in the sense that the values of the fitted coefficients do not
specify a valid point process).
If |
verbose |
Logical flag indicating whether to print progress reports
from |
progress |
Logical flag indicating whether to print progress reports for the sequence of simulations. |
new.coef |
New values for the canonical parameters of the model.
A numeric vector of the same length as |
newdata |
List of pixel images, functions or numeric values
to replace the |
drop |
Logical. If |
This function is a method for the generic function
simulate for the class "ppm" of fitted
point process models.
Simulations are performed by rmh.ppm.
If singlerun=FALSE (the default), the simulated patterns are
the results of independent runs of the Metropolis-Hastings
algorithm. If singlerun=TRUE, a single long run of the
algorithm is performed, and the state of the simulation is saved
every nsave iterations to yield the simulated patterns.
In the case of a single run, the behaviour is controlled
by the parameters nsave,nburn,nrep. These
are described in rmhcontrol. They may be passed
in the ... arguments or included in control.
It is sufficient to specify two
of the three parameters nsave,nburn,nrep.
A list of length nsim containing simulated point patterns
(objects of class "ppp").
It also belongs to the class "solist", so that it can be
plotted, and the class "timed", so that the total computation
time is recorded.
It is possible to simulate the model object on a window that is
different from the original window (the window containing the data
to which the model was fitted). To do this, specify the argument
w as the window in which the simulated patterns should be
generated, as in simulate(object, w=wsim).
If the model is stationary, then this is sufficient.
However if the model depends on spatial covariates, then the values of
these covariates inside the new simulation window will be required.
If the original covariates are functions, or pixel images that are
defined on a region that includes the new simulation window, then no
further action is needed, and simulate(object, w=wsim) should
work. Otherwise, the values of the required covariates inside the new
simulation window should be supplied in the argument newdata.
and \rolf
ppm,
simulate.kppm,
simulate
fit <- ppm(japanesepines ~1, Strauss(0.1))
simulate(fit, 2)
simulate(fit, 2, singlerun=TRUE, nsave=1e4, nburn=1e4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.