This function is an experimental extension to the
  point process model fitting command ppm.
  The extension allows the trend of the model to include irregular parameters,
  which will be maximised by a Newton-type iterative
  method, using nlm.
For the sake of explanation,
  consider a Poisson point process with intensity function
  \(\lambda(u)\) at location \(u\). Assume that
  $$
    \lambda(u) = \exp(\alpha + \beta Z(u)) \, f(u, \gamma)
  $$
  where \(\alpha,\beta,\gamma\) are
  parameters to be estimated, \(Z(u)\) is a spatial covariate
  function, and \(f\) is some known function.
  Then the parameters
  \(\alpha,\beta\) are called regular because they
  appear in a loglinear form; the parameter 
  \(\gamma\) is called irregular.
  
To fit this model using ippm, we specify the
  intensity using the trend formula
  in the same way as usual for ppm.
  The trend formula is a representation of the log intensity.
  In the above example the log intensity is
  $$
    \log\lambda(u) = \alpha + \beta Z(u) + \log f(u, \gamma)
  $$
  So the model above would be encoded with the trend formula
  ~Z + offset(log(f)). Note that the irregular part of the model
  is an offset term, which means that it is included in the log trend
  as it is, without being multiplied by another regular parameter.
The optimisation runs faster if we specify the derivative
  of \(\log f(u,\gamma)\) with
  respect to \(\gamma\). We call this the
  irregular score. To specify this, the user must write an R function
  that computes the irregular score for any value of
  \(\gamma\) at any location (x,y).
  
Thus, to code such a problem,
- The argument - trendshould define the
    log intensity, with the irregular part as an offset;
 
- The argument - startshould be a list
    containing initial values of each of the irregular parameters;
 
- The argument - iScore, if provided,
    must be a list (with one entry
    for each entry of- start) of functions
    with arguments- x,y,…, that evaluate the partial derivatives
    of \(\log f(u,\gamma)\) with
    respect to each irregular parameter.
 
The coded example below illustrates the model with two irregular
  parameters \(\gamma,\delta\) and irregular term
  $$
    f((x,y), (\gamma, \delta)) = 1 + \exp(\gamma - \delta x^3)
  $$
Arguments … passed to ppm may
  also include interaction. In this case the model is not
  a Poisson point process but a more general Gibbs point process;
  the trend formula trend 
  determines the first-order trend
  of the model (the first order component of the conditional intensity),
  not the intensity.