GRTHIN procedure
Randomly thins a spatial point pattern (M.A. Mugglestone, S.A. Harding, B.Y.Y. Lee, P.J. Diggle & B.S. Rowlingson).
Option
Parameters
Description
This procedure randomly thins a spatial point pattern with coordinates specified by the parameters OLDX and OLDY. The number of points required in the thinned pattern is specified using the NPOINTS parameter which must be a positive integer. If NPOINTS is equal to or greater than the number of points in the original pattern then no points will be deleted. The coordinates of the points which remain after thinning can be saved using the parameters NEWX and NEWY. The SEED parameter allows a seed to be supplied for generating the random numbers used to select the thinned points (thereby producing reproducible results). If this is not supplied, the default of 0 initializes the random number generator (if necessary) from the system clock.
Printed output is controlled by the PRINT option. The default setting of summary prints the horizontal and vertical coordinates of the points which remain after thinning under the headings NEWX and NEWY.
Option: PRINT.
Parameters: OLDY, OLDX, NPOINTS, NEWY, NEWX, SEED.
Method
A procedure PTCHECKXY is called to check that OLDX and OLDY have identical restrictions. A dummy variate with the same number of elements as OLDX and OLDY and containing uniform random numbers in the interval (0,1) is created using the URAND function. The SORT function is then used to sort the elements of OLDX and OLDY into the order which would put the elements of the dummy variate in ascending order. Finally, the first NPOINTS elements of the sorted coordinates are transferred to the variates NEWX and NEWY using the EQUATE directive.
Action with
RESTRICT
If OLDX and OLDY are restricted, only the subset of values specified by the restriction will be included in the calculations.