# mincontrast

##### Method of Minimum Contrast

A general algorithm for fitting theoretical point process models to point pattern data by the Method of Minimum Contrast.

##### Usage

```
mincontrast(observed, theoretical, startpar, ...,
ctrl=list(q = 1/4, p = 2, rmin=NULL, rmax=NULL),
fvlab=list(label=NULL, desc="minimum contrast fit"),
explain=list(dataname=NULL, modelname=NULL, fname=NULL))
```

##### Arguments

- observed
- Summary statistic, computed for the data.
An object of class
`"fv"`

. - theoretical
- An R language function that calculates the theoretical expected value of the summary statistic, given the model parameters. See Details.
- startpar
- Vector of initial values of the parameters of the
point process model (passed to
`theoretical`

). - ...
- Additional arguments passed to the function
`theoretical`

. - ctrl
- Optional. List of arguments controlling the optimisation. See Details.
- fvlab
- Optional. List containing some labels for the return value. See Details.
- explain
- Optional. List containing strings that give a human-readable description of the model, the data and the summary statistic.

##### Details

This function is a general algorithm for fitting point process models
by the Method of Minimum Contrast. If you want to fit the
Thomas process, see `thomas.estK`

.
If you want to fit a log-Gaussian Cox process, see
`lgcp.estK`

.

The Method of Minimum Contrast is a general technique for fitting a point process model to point pattern data. First a summary function (typically the $K$ function) is computed from the data point pattern. Second, the theoretical expected value of this summary statistic under the point process model is derived (as an algebraic expression involving the parameters of the model). Then the model is fitted by finding the optimal parameter values for the model to give the closest match between the theoretical and empirical curves.

The argument `observed`

should be an object of class `"fv"`

(see `fv.object`

) containing the values of a summary
statistic computed from the data point pattern. Usually this is the
function $K(r)$ computed by `Kest`

or one of its relatives.
The argument `theoretical`

should be a user-supplied function
that computes the theoretical expected value of the summary statistic.
It must have an argument named `par`

that will be the vector
of parameter values for the model (the length and format of this
vector are determined by the starting values in `startpar`

).
The function `theoretical`

should also expect a second argument
(the first argument other than `par`

)
containing values of the distance $r$ for which the theoretical
value of the summary statistic $K(r)$ should be computed.
The value returned by `theoretical`

should be a vector of the
same length as the given vector of $r$ values.

The argument `ctrl`

determines the contrast criterion
(the objective function that will be minimised).
The algorithm minimises the criterion
$$D(\theta)=
\int_{r_{\mbox{\scriptsize min}}}^{r_{\mbox{\scriptsize max}}}
|\hat F(r)^q - F_\theta(r)^q|^p \, {\rm d}r$$
where $\theta$ is the vector of parameters of the model,
$\hat F(r)$ is the observed value of the summary statistic
computed from the data, $F_\theta(r)$ is the
theoretical expected value of the summary statistic,
and $p,q$ are two exponents.

The other arguments just make things print nicely.
The argument `fvlab`

contains labels for the component
`fit`

of the return value.
The argument `explain`

contains human-readable strings
describing the data, the model and the summary statistic.

##### Value

- An object of class
`"minconfit"`

. There are methods for printing and plotting this object. It contains the following components: par Vector of fitted parameter values. fit Function value table (object of class `"fv"`

) containing the observed values of the summary statistic (`observed`

) and the theoretical values of the summary statistic computed from the fitted model parameters.opt The return value from the optimizer `optim`

.crtl The control parameters of the algorithm. info List of explanatory strings.

##### References

~put references to the literature/web site here ~

##### See Also

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