objsurf: Objective Function Surface

View source: R/objsurf.R

objsurfR Documentation

Objective Function Surface

Description

For a model that was fitted by optimisation, compute the values of the objective function in a neighbourhood of the optimal value.

Usage

objsurf(x, ...)

## S3 method for class 'dppm'
objsurf(x, ..., ngrid = 32, xlim=NULL, ylim=NULL,
                               enclose=FALSE,
                               ratio = 1.5, verbose = TRUE)

## S3 method for class 'kppm'
objsurf(x, ..., ngrid = 32, xlim=NULL, ylim=NULL,
                               enclose=FALSE,
                               ratio = 1.5, verbose = TRUE)

## S3 method for class 'minconfit'
objsurf(x, ..., ngrid = 32, xlim=NULL, ylim=NULL,
                               ratio = 1.5, verbose = TRUE)

Arguments

x

Some kind of model that was fitted by finding the optimal value of an objective function. An object of class "dppm", "kppm" or "minconfit".

...

Extra arguments are usually ignored.

ngrid

Number of grid points to evaluate along each axis. Either a single integer, or a pair of integers. For example ngrid=32 would mean a 32 * 32 grid.

xlim, ylim

Optional. Numeric vectors of length 2, specifying the limits for the two parameters to be considered.

enclose

Logical value specifying whether the default values of xlim and ylim should enclose the history of all function evaluations. See Details.

ratio

Number greater than 1 determining the default ranges of parameter values. See Details.

verbose

Logical value indicating whether to print progress reports.

Details

The object x should be some kind of model that was fitted by maximising or minimising the value of an objective function. The objective function will be evaluated on a grid of values of the model parameters.

Currently the following types of objects are accepted:

  • an object of class "dppm" representing a determinantal point process. See dppm.

  • an object of class "kppm" representing a cluster point process or Cox point process. See kppm.

  • an object of class "minconfit" representing a minimum-contrast fit between a summary function and its theoretical counterpart. See mincontrast.

The result is an object of class "objsurf" which can be printed and plotted: see methods.objsurf.

The range of parameter values to be considered is determined by xlim and ylim. The default values of xlim and ylim are chosen as follows.

  • if enclose=FALSE (the default), the default values of xlim and ylim are the ranges from opt/ratio to opt * ratio where opt is the optimal parameter value on the surface.

  • If enclose=TRUE, and if x contains a trajectory (history of function evaluations), then xlim and ylim will be the ranges of parameter values examined in the trajectory.

Value

An object of class "objsurf" which can be printed and plotted. Essentially a list containing entries x, y, z giving the parameter values and objective function values.

There are methods for plot, print, summary, image, contour and persp.

Author(s)

\adrian

and \ege.

See Also

methods.objsurf, kppm, mincontrast

Examples

   fit <- kppm(redwood ~ 1, "Thomas")
   os <- objsurf(fit)

   if(interactive()) {
     plot(os)
     contour(os, add=TRUE)
     persp(os)
   }

spatstat.model documentation built on May 29, 2024, 2:42 a.m.