Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

simulate.kppm

Simulate a Fitted Cluster Point Process Model


Description

Generates simulated realisations from a fitted cluster point process model.

Usage

## S3 method for class 'kppm'
simulate(object, nsim = 1, seed=NULL, ...,
         window=NULL, covariates=NULL,
         n.cond = NULL, w.cond = NULL,
         verbose=TRUE, retry=10,
         drop=FALSE)

Arguments

object

Fitted cluster point process model. An object of class "kppm".

nsim

Number of simulated realisations.

seed

an object specifying whether and how to initialise the random number generator. Either NULL or an integer that will be used in a call to set.seed before simulating the point patterns.

...

Additional arguments passed to the relevant random generator. See Details.

window

Optional. Window (object of class "owin") in which the model should be simulated.

covariates

Optional. A named list containing new values for the covariates in the model.

n.cond

Optional. Integer specifying a fixed number of points. See the section on Conditional Simulation.

w.cond

Optional. Conditioning region. A window (object of class "owin") specifying the region which must contain exactly n.cond points. See the section on Conditional Simulation.

verbose

Logical. Whether to print progress reports (when nsim > 1).

retry

Number of times to repeat the simulation if it fails (e.g. because of insufficient memory).

drop

Logical. If nsim=1 and drop=TRUE, the result will be a point pattern, rather than a list containing a point pattern.

Details

This function is a method for the generic function simulate for the class "kppm" of fitted cluster point process models.

Simulations are performed by rThomas, rMatClust, rCauchy, rVarGamma or rLGCP depending on the model.

Additional arguments ... are passed to the relevant function performing the simulation. For example the argument saveLambda is recognised by all of the simulation functions.

The return value is a list of point patterns. It also carries an attribute "seed" that captures the initial state of the random number generator. This follows the convention used in simulate.lm (see simulate). It can be used to force a sequence of simulations to be repeated exactly, as shown in the examples for simulate.

Value

A list of length nsim containing simulated point patterns (objects of class "ppp"). (For conditional simulation, the length of the result may be shorter than nsim).

The return value also carries an attribute "seed" that captures the initial state of the random number generator. See Details.

Conditional Simulation

If n.cond is specified, it should be a single integer. Simulation will be conditional on the event that the pattern contains exactly n.cond points (or contains exactly n.cond points inside the region w.cond if it is given).

Conditional simulation uses the rejection algorithm described in Section 6.2 of Moller, Syversveen and Waagepetersen (1998). There is a maximum number of proposals which will be attempted. Consequently the return value may contain fewer than nsim point patterns.

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz and Ege Rubak rubak@math.aau.dk

References

Baddeley, A., Rubak, E. and Turner, R. (2015) Spatial Point Patterns: Methodology and Applications with R. Chapman and Hall/CRC Press.

Moller, J., Syversveen, A. and Waagepetersen, R. (1998) Log Gaussian Cox Processes. Scandinavian Journal of Statistics 25, 451–482.

See Also

Examples

if(offline <- !interactive()) {
    spatstat.options(npixel=32, ndummy.min=16)
  }

  fit <- kppm(redwood ~x, "Thomas")
  simulate(fit, 2)

  simulate(fit, n.cond=60)

  if(offline) reset.spatstat.options()

spatstat.core

Core Functionality of the 'spatstat' Family

v2.1-2
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Kasper Klitgaard Berthelsen [ctb], Achmad Choiruddin [ctb], Jean-Francois Coeurjolly [ctb], Ottmar Cronie [ctb], Tilman Davies [ctb], Julian Gilbey [ctb], Yongtao Guan [ctb], Ute Hahn [ctb], Kassel Hingee [ctb], Abdollah Jalilian [ctb], Marie-Colette van Lieshout [ctb], Greg McSwiggan [ctb], Tuomas Rajala [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Plenge Waagepetersen [ctb], Hangsheng Wang [ctb]
Initial release
2021-04-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.