# pixelquad

##### Quadrature Scheme Based on Pixel Grid

Makes a quadrature scheme with a dummy point at every pixel of a pixel image.

##### Usage

`pixelquad(X, W = as.owin(X))`

##### Arguments

- X
- Point pattern (object of class
`"ppp"`

) containing the data points for the quadrature scheme. - W
- Specifies the pixel grid.
A pixel image (object of class
`"im"`

), a window (object of class`"owin"`

), or anything that can be converted to a window by`as.owin`

.

##### Details

This is a method for producing a quadrature scheme
for use by `ppm`

. It is an alternative to
`quadscheme`

.
The function `ppm`

fits a point process model to an
observed point pattern using
the Berman-Turner quadrature approximation (Berman and Turner, 1992;
Baddeley and Turner, 2000) to the pseudolikelihood of the model.
It requires a quadrature scheme consisting of
the original data point pattern, an additional pattern of dummy points,
and a vector of quadrature weights for all these points.
Such quadrature schemes are represented by objects of class
`"quad"`

. See `quad.object`

for a description of this class.

Given a grid of pixels, this function creates a quadrature scheme in which there is one dummy point at the centre of each pixel. The counting weights are used (the weight attached to each quadrature point is 1 divided by the number of quadrature points falling in the same pixel).

The argument `X`

specifies the locations of the data points
for the quadrature scheme. Typically this would be a point pattern
dataset.

The argument `W`

specifies the grid of pixels for the dummy
points of the quadrature scheme. It should be a pixel image
(object of class `"im"`

), a window (object of class
`"owin"`

), or anything that can
be converted to a window by `as.owin`

. If `W`

is a
pixel image or a binary mask (a window of type `"mask"`

)
then the pixel grid of `W`

will be used. If `W`

is a
rectangular or polygonal window, then it will first be converted to a
binary mask using `as.mask`

at the default pixel
resolution.

##### Value

- An object of class
`"quad"`

describing the quadrature scheme (data points, dummy points, and quadrature weights) suitable as the argument`Q`

of the function`ppm()`

for fitting a point process model.The quadrature scheme can be inspected using the

`print`

and`plot`

methods for objects of class`"quad"`

.

##### See Also

##### Examples

```
W <- owin(c(0,1),c(0,1))
X <- runifpoint(42, W)
W <- as.mask(W,dimyx=128)
pixelquad(X,W)
```

*Documentation reproduced from package spatstat, version 1.29-0, License: GPL (>= 2)*