Generates a bounding or surrounding box for a spatial point pattern (M.A. Mugglestone, S.A. Harding, B.Y.Y. Lee, P.J. Diggle & B.S. Rowlingson).

### Options

`PRINT` = string token |
What to print (`summary` ); default `summ` |
---|---|

`METHOD` = string token |
Type of box to form (`bounding` , `surrounding` ); default `boun` |

### Parameters

`Y` = variates |
Vertical coordinates of each spatial point pattern; no default – this parameter must be set |
---|---|

`X` = variates |
Horizontal coordinates of each spatial point pattern; no default – this parameter must be set |

`YBOX` = variates |
Variates to receive the vertical coordinates of the bounding or surrounding boxes |

`XBOX` = variates |
Variates to receive the horizontal coordinates of the bounding or surrounding boxes |

`YFRACTION` = scalars |
How much to extend the extremes of the vertical coordinates of each surrounding box as a fraction of the range of the vertical coordinates; default 0.1 |

`XFRACTION` = scalars |
How much to extend the extremes of the horizontal coordinates of each surrounding box as a fraction of the range of the horizontal coordinates; default 0.1 |

### Description

This procedure takes as input two variates containing the coordinates of a spatial point pattern (specified by the `X`

and `Y`

parameters) and returns the coordinates of either a bounding or a surrounding box, according to the setting of the `METHOD`

option. The default, `METHOD=bounding`

, provides a bounding box, defined as the smallest rectangle such that all the events in the spatial point pattern lie inside the box or on its boundary. The coordinates of the bounding box are the coordinates of its four corners, in the order lower left, lower right, upper right, and upper left. The surrounding box (`METHOD=surrounding`

) is a rectangle which contains all the points. It is obtained by extending the vertical and horizontal edges of the bounding box by specified fractions of the range of values in `X`

and `Y`

, respectively. The parameters `XFRACTION`

and `YFRACTION`

can be used to specify the proportional extension required in each direction; the default value of both parameters is 0.1. The coordinates of the surrounding box are the coordinates of its four corners in the order lower left, lower right, upper right, upper left. The coordinates of the bounding or surrounding box can be saved using the parameters `XBOX`

and `YBOX`

.

Printed output is controlled by the `PRINT`

option. The default setting of `summary`

prints the coordinates of the bounding or surrounding box under the headings `XBOX`

and `YBOX`

.

Option: `PRINT`

.

Parameters: `Y`

, `X`

, `YBOX`

, `XBOX`

, `YFRACTION`

, `XFRACTION`

.

### Method

A procedure `PTCHECKXY`

is called to check that `X`

and `Y`

have identical restrictions. The minimum, maximum and range of the horizontal (`X`

) and vertical (`Y`

) coordinates are then calculated. For a bounding box, the coordinates are calculated as (min(`X`

), min(`Y`

)), (max(`X`

), min(`Y`

)), (max(`X`

), max(`Y`

)), (min(`X`

), max(`Y`

)). For a surrounding box the coordinates are

(min(`X`

) – `XFRACTION`

× range(`X`

), min(`Y`

) – `YFRACTION`

× range(`Y`

)),

(max(`X`

) + `XFRACTION`

× range(`X`

), min(`Y`

) – `YFRACTION`

× range(`Y`

)),

(max(`X`

) + `XFRACTION`

× range(`X`

), max(`Y`

) + `YFRACTION`

× range(`Y`

)),

(min(`X`

) – `XFRACTION`

× range(`X`

), max(`Y`

) + `YFRACTION`

× range(`Y`

)).

### Action with `RESTRICT`

If `X`

and `Y`

are restricted, only the subset of values specified by the restriction will be included in the calculations.

See also

Procedures: `CONVEXHULL`

, `PTSINPOLYGON`

.

Commands for: Spatial statistics.

### Example

CAPTION 'PTBOX example'; STYLE=meta VARIATE pinex,piney READ [SETNVALUES=yes] pinex,piney 0.09 0.91 0.02 0.71 0.03 0.62 0.18 0.61 0.03 0.52 0.02 0.41 0.16 0.35 0.13 0.33 0.13 0.27 0.03 0.21 0.13 0.14 0.08 0.11 0.02 0.02 0.18 0.98 0.31 0.89 0.22 0.58 0.13 0.52 0.21 0.38 0.23 0.27 0.23 0.11 0.41 0.98 0.44 0.97 0.42 0.93 0.42 0.48 0.43 0.36 0.59 0.92 0.63 0.92 0.63 0.88 0.66 0.88 0.58 0.83 0.53 0.69 0.52 0.68 0.49 0.58 0.52 0.48 0.52 0.09 0.58 0.06 0.68 0.66 0.68 0.63 0.67 0.53 0.67 0.48 0.67 0.41 0.68 0.34 0.66 0.24 0.73 0.27 0.74 0.11 0.78 0.06 0.79 0.02 0.86 0.03 0.84 0.88 0.94 0.89 0.95 0.83 0.79 0.79 0.84 0.71 0.83 0.68 0.86 0.65 0.79 0.61 0.93 0.48 0.83 0.42 0.93 0.31 0.93 0.23 0.97 0.64 0.96 0.64 0.96 0.61 0.96 0.57 0.97 0.38 : PTBOX [METHOD=surround] Y=piney; X=pinex