# profilepl

##### Profile Maximum Pseudolikelihood

Fits point process models by profile maximum pseudolikelihood

##### Usage

`profilepl(s, f, ..., rbord = NULL, verbose = TRUE)`

##### Arguments

- s
- Data frame containing values of the irregular parameters over which the profile pseudolikelihood will be computed.
- f
- Function (such as
`Strauss`

) that generates an interpoint interaction object, given the values of the irregular parameters. - ...
- Data passed to
`ppm`

to fit the model. - rbord
- Radius for border correction (same for all models). If omitted, this will be computed from the interactions.
- verbose
- Logical flag indicating whether to print progress reports.

##### Details

The model-fitting function `ppm`

fits point process
models to point pattern data. However,
only the `ppm`

. The model may also depend on `ppm`

.

This function `profilepl`

is a wrapper which finds the values of the
irregular parameters that give the best fit. It uses the method of
maximum profile pseudolikelihood.

The argument `f`

would typically be one of the functions
`Strauss`

,
`StraussHard`

,
`Softcore`

,
`DiggleGratton`

,
`Geyer`

,
`LennardJones`

or `OrdThresh`

.
For the moment, assume this is so.
The argument `s`

must be a data frame whose columns contain
values of the irregular parameters. The names of the columns of
`s`

must match the argument names of `f`

.

To apply the method of profile maximum pseudolikelihood,
each row of `s`

will be taken in turn; the parameter values in this row
will be passed to `f`

, resulting in an interaction object.
Then `ppm`

will be applied to the data `...`

using this interaction; this results in a fitted point process model.
The value of the log pseudolikelihood from this model is stored.
After all rows of `s`

have been processed in this way, the
row giving the maximum value of log pseudolikelihood will be found.

The object returned by `profilepl`

contains the profile
pseudolikelihood function, the best fitting model, and other data.
It can be plotted (yielding a
plot of the log pseudolikelihood values against the irregular
parameters) or printed (yielding information about the best fitting
values of the irregular parameters).
In general, `f`

may be any function that will return
an interaction object (object of class `"interact"`

)
that can be used in a call to `ppm`

. Each argument of
`f`

must be a single value.

##### Value

##### Examples

```
data(cells)
# one irregular parameter
s <- data.frame(r=seq(0.05,0.15, by=0.01))
<testonly>s <- data.frame(r=c(0.05,0.1,0.15))</testonly>
ps <- profilepl(s, Strauss, cells)
ps
plot(ps)
# two irregular parameters
s <- expand.grid(r=seq(0.05,0.15, by=0.01),sat=1:3)
<testonly>s <- expand.grid(r=c(0.05,0.1,0.15),sat=1:2)</testonly>
pg <- profilepl(s, Geyer, cells)
pg
plot(pg)
pg$fit
```

*Documentation reproduced from package spatstat, version 1.9-3, License: GPL version 2 or newer*