ppm(Q, trend=~1, interaction=Poisson(),
       ...,
       covariates=NULL,
       correction="border",
       rbord=reach(interaction),
       use.gam=FALSE,
       method="mpl",
       forcefit=FALSE,
       nsim=100, nrmh=1e5, start=NULL, control=list(nrep=nrmh),
       verb=TRUE)"ppp")
    to which the model will be fitted,
    or a quadrature scheme (of class "quad")
    containing this pattern.~1, indicates the model is stationary
  and no trend is to be fitted."interact"
    describing the point process interaction
    structure, or NULL indicating that a Poisson process (stationary
    or nonstationary) should be fitted."border" indicating the border correction.
    Other possibilities may include "Ripley", "isotropic",
    "translate" and "none"correction = "border"
    this argument specifies the distance by which
    the window should be eroded for the border correction.TRUE then computations are performed
    using gam instead of glm."mpl" for the method of Maximum PseudoLikelihood,
    and "ho" for the Huang-Ogata approximate maximum likelihood
    method.forcefit=FALSE, some trivial models will be
    fitted by a shortcut. If forcefit=TRUE,
    the generic fitting method will always be used.method="ho")method="ho")rmh controlling the behaviour
    of the Metropolis-Hastings algorithm (for method="ho")method="ho")"ppm" describing a fitted point process
  model.
 
  The fitted parameters can be obtained just by printing this object.
  Fitted spatial trends can be extracted using the predict method
  for this object (see predict.ppm).  See ppm.object for details of the format of this object.
[object Object],[object Object],[object Object]
Huang, F. and Ogata, Y. Improvements of the maximum pseudo-likelihood estimators in various spatial statistical models. Journal of Computational and Graphical Statistics 8 (1999) 510-530. Jensen, J.L. and Moeller, M. Pseudolikelihood for exponential family models of spatial point processes. Annals of Applied Probability 1 (1991) 445--461. Jensen, J.L. and Kuensch, H.R. On asymptotic normality of pseudo likelihood estimates for pairwise interaction processes, Annals of the Institute of Statistical Mathematics 46 (1994) 475-486.
ppp, 
  quadscheme, 
  ppm.object,
  Poisson,
  Strauss,
  StraussHard,
  MultiStrauss,
  MultiStraussHard,
  Softcore,
  DiggleGratton,
  Pairwise,
  PairPiece,
  AreaInter,
  Geyer,
  BadGey,
  LennardJones,
  Saturated,
  OrdThresh,
  Ordppm()$theta[2]
  less than or equal to 0.
  The current version of ppm maximises the pseudolikelihood
  without constraining the parameters, and does not apply any checks for
  sanity after fitting the model. 
 
  The trend formula should not use any variable names
  beginning with the prefixes .mpl or Interaction
  as these names are reserved
  for internal use. The data frame covariates should have as many rows
  as there are points in Q. It should not contain
  variables called x, y or marks
  as these names are reserved for the Cartesian coordinates
  and the marks.
 
  If the model formula involves one of the functions
  poly(), bs()
  or ns()
  (e.g. applied to spatial coordinates x and y),
  the fitted coefficients can be misleading.
  The resulting fit is not to the raw spatial variates
  (x, x^2, x*y, etc.) 
  but to a transformation of these variates.  The transformation is implemented
  by poly() in order to achieve better numerical stability.
  However the
  resulting coefficients are appropriate for use with the transformed
  variates, not with the raw variates.  
  This affects the interpretation of the constant
  term in the fitted model, logbeta. 
  Conventionally, $\beta$ is the background intensity, i.e. the  
  value taken by the conditional intensity function when all predictors
  (including spatial or ``trend'' predictors) are set equal to $0$.
  However the coefficient actually produced is the value that the
  log conditional intensity takes when all the predictors, 
  including the transformed
  spatial predictors, are set equal to 0, which is not the same thing.
  Worse still, the result of predict.ppm can be
  completely wrong if the trend formula contains one of the
  functions poly(), bs()
  or ns(). This is a weakness of the underlying
  function predict.glm. 
  If you wish to fit a polynomial trend, 
  we offer an alternative to poly(),
  namely polynom(), which avoids the
  difficulty induced by transformations.  It is completely analogous
  to poly except that it does not orthonormalise.
  The resulting coefficient estimates then have
  their natural interpretation and can be predicted correctly. 
  Numerical stability may be compromised.
  Values of the maximised pseudolikelihood are not comparable
  if they have been obtained with different values of rbord.
}
Q <- quadscheme(nztrees) ppm(Q) # equivalent.
ppm(nztrees, ~ x) # fit the nonstationary Poisson process # with intensity function lambda(x,y) = exp(a + bx) # where x,y are the Cartesian coordinates # and a,b are parameters to be estimated
ppm(nztrees, ~ polynom(x,2)) # fit the nonstationary Poisson process # with intensity function lambda(x,y) = exp(a + bx + cx^2)
library(splines) ppm(nztrees, ~ bs(x,df=3)) # WARNING: do not use predict.ppm() on this result # Fits the nonstationary Poisson process # with intensity function lambda(x,y) = exp(B(x)) # where B is a B-spline with df = 3 ppm(nztrees, ~1, Strauss(r=10), rbord=10) # Fit the stationary Strauss process with interaction range r=10 # using the border method with margin rbord=10 ppm(nztrees, ~ x, Strauss(13), correction="periodic") # Fit the nonstationary Strauss process with interaction range r=13 # and exp(first order potential) = activity = beta(x,y) = exp(a+bx) # using the periodic correction.
# Huang-Ogata fit:
ppm(nztrees, ~1, Strauss(r=10), method="ho")
# COVARIATES # X <- rpoispp(42) weirdfunction <- function(x,y){ 10 * x^2 + runif(length(x))} Zimage <- as.im(weirdfunction, unit.square()) # # (a) covariate values in pixel image ppm(X, ~ y + Z, covariates=list(Z=Zimage)) # # (b) covariate values in data frame Q <- quadscheme(X) xQ <- x.quad(Q) yQ <- y.quad(Q) Zvalues <- weirdfunction(xQ,yQ) ppm(Q, ~ y + Z, covariates=data.frame(Z=Zvalues)) # Note Q not X
 ## MULTITYPE POINT PROCESSES ### 
 data(lansing)
 # Multitype point pattern --- trees marked by species
 # fit stationary marked Poisson process
 # with different intensity for each species
ppm(lansing, ~ marks, Poisson())
 # fit nonstationary marked Poisson process
 # with different log-cubic trend for each species
ppm(lansing, ~ marks * polynom(x,y,3), Poisson())