1. Home
2. DPSPECTRALPLOT procedure

# DPSPECTRALPLOT procedure

Calculates an estimate of the spectrum of a spatial point pattern (C.J. Alexander & D.A.Murray).

### Options

`PLOT` = string tokens Which graphs to plot (`periodogram`, `rspectrum`, `thetaspectrum`, `weights`); default `peri`, `rspe`, `thet`, `weig` Number of rows for periodogram; default 17 Number of columns for periodogram; default 32 Whether to normalize the coordinates of the points within the study region to a unit square (`normalize`, `none`); default `norm`

### Parameters

`Y` = variates Vertical coordinates of each spatial point pattern Horizontal coordinates of each spatial point pattern Y-coordinates for the rectangular study region X-coordinates for the rectangular study region Y-coordinates for the missing region polygons X-coordinates for the missing region polygons Grouping factor where each level represents a different polygon for the missing regions. Saves the periodogram Saves the weights used for the inter-event calculation Saves the y-coordinates for the inter-event calculation Saves the x-coordinates for the inter-event calculation

### Description

Spectral analysis looks for evidence of spatial structure in a point pattern by examining its second-order properties. Formally the spectral density function, denoted by f(ω), is defined as the Fourier transform of the auto-covariance function, κ(c), such that

f(ω) = ∫ κ(c) exp(-i ω′ c) dc

where c is the vector separating two points in the region and i=√-1 (Bartlett 1964). An estimator of this spectral density function (or periodogram) can be calculated using the discrete Fourier transform of the coordinates from the set of N events of the spatial point pattern observed within a rectangular study region

F(p, q) = ∑j=1…N exp{ -2πi (pxj* + qyj*) }

This is evaluated at integer values of p (= 0, +1, +2 …) and q (= 0, +1, +2 …) which represent the frequency over the x– and y-coordinate directions. In order to reduce bias near p = q = 0, it is usual to standardise the original coordinates so that xj and yj are rescaled from the rectangular study region to xj* and yj* within the unit square. The periodogram is then

f(ωP, ωQ) = F(p, q) F(p, q)

where F(p, q) is the complex conjugate of the discrete Fourier transform (Bartlett 1964). Thus, the estimated spectrum analyses the point pattern for important features of both the distribution’s scale and direction. For a pattern observed within a rectangular boundary, the periodogram will be approximately unbiased. However, if there are missing regions within this outer boundary, the “holes” will produce positive bias, primarily in the low order frequencies. This can be corrected using a method which weights the contribution of a particular inter-event vector in the calculation of the periodogram. Each inter-event vector is weighted proportionate to the amount to which it is affected by the presence of the missing regions and is also conditional on the observed configuration of the spatial point pattern relative to these holes (Alexander 2006).

Although the periodogram is informative about directional as well as scale effects, it is often easier to look at these aspects through its polar representation. Mugglestone & Renshaw (1996) show that any ordinate of the periodogram f^(ωP, ωQ) can be represented in the form g^(ωr, ωθ) where r = √(p2 + q2) and θ = tan-1(p / q). The R-spectrum is then defined as

f^R(r) = 1 / nrrθ g^(ωr′, ωθ)                     r = 1, 2 …

where the summation is over the nr ordinates of the periodogram where r-1 < r′ ≤ r. This is used to investigate scales of pattern under the assumption of isotropy by averaging over those ordinates that have similar values of r. Further, the θ-spectrum is defined to be

f^ζ(ζ) = (1/nθ) g^(ωr, ωθ′)                             θ = 0°, 10°, 20° … 170°

with the summation being over the nΘ ordinates for which

θ – 5° < θ′ < θ + 5°.

The homogeneous Poisson process represents complete spatial randomness (CSR) in that it generates points which are uniformly and independently distributed over the study region. This acts as a reasonable null hypothesis against which to compare any observed point pattern. The spectrum for a CSR point pattern has each ordinate equal to 2 for all values of p and q which demonstrates that there are no features of scale or direction discernable. For a clustered pattern, there will be a peak in periodogram values at the lowest frequencies which will fall off as frequency increases. Regular patterns show lower periodogram values (relative to CSR) for the lowest frequency ordinates rising to a peak at the frequency which captures the regularity of the spatial structure. Patterns with any directional structure will show peaks in periodogram values for (p, q) ordinates which match the orientation and scale of that spatial feature.

`DPSPECTRALPLOT` calculates the estimated spectral density (or periodogram) given the coordinates of a spatial point pattern (specified by the parameters `X` and `Y`) observed within a rectangular study region (specified by the parameters `XPOLYGON` and `YPOLYGON`). Coordinates of missing regions can be supplied by the `XHOLEPOLYGON` and `YHOLEPOLYGON` parameters. If there is more than one missing region then an additional factor should be supplied using the `HOLEGROUPS` parameter, where each level defines a different missing region.

The output of the procedure is a matrix of values of the periodogram estimated over a range of p and q (specified by the `NROWS` and `NCOLUMNS` options). The estimates of the spectrum can be saved using the parameter `PERIODOGRAM`. Weights used for the conditional correction can be saved in a variate using the parameter `WEIGHTS` and the associated inter-event vector coordinates can be saved using the `XINTEREVENT` and `YINTEREVENT` parameters.

If the `XPOLYGON` and `YPOLYGON` parameters do not define the unit square (0,1), then the `normalize` setting of the `SCALING` option can be used to standardise the original coordinates so that the `X` and `Y` are rescaled from the rectangular study region to within the unit square.

The type of plot is controlled using the `PLOT` option. The `periodogram` setting produces a shade plot of the periodogram matrix and, if any missing regions are the supplied, the `weight` setting will plot the conditional weights versus the inter-event vector distances. The `rspectrum` and `thetaspectrum` settings produce a plot of the polar R-spectrum and Θ-spectrum respectively.

Options: `PLOT`, `NROWS`, `NCOLUMNS`, `SCALING`.

Parameters: `Y`, `X`, `YPOLYGON`, `XPOLYGON`, `YHOLEPOLYGON`, `XHOLEPOLYGON`, `HOLEGROUPS`, `PERIODOGRAM`, `WEIGHTS`, `YINTEREVENT`, `XINTEREVENT`.

### Method

For estimating the conditional correction, `DPSPECTRALPLOT` calls `PTCLOSEPOLYGON` to close the polygons specified by `XHOLEPOLYGON`, `YHOLEPOLYGON` and `HOLEGROUPS`. `DPSPECTRALPLOT` then calls procedure `PTPASS` to execute a Fortran program to calculate an estimate of the spectrum corrected for the influence of any missing regions. Similarly `PTPASS` is used to execute other Fortran programs to calculate the periodogram, r- and θ-spectra.

### Action with `RESTRICT`

The variates `X`, `Y`, `XPOLYGON`, `YPOLYGON`, `XHOLEPOLYGON`, `YHOLEPOLYGON` and factor `HOLEGROUPS` may be restricted, as long as `X` has the same restriction as `Y`, `YHOLEPOLYGON` has the same restriction as `XHOLEPOLYGON`, and `XPOLYGON` has the same restriction as `YPOLYGON` and `GPOLYGON`. Only the subset of values specified by each restriction will be included in the calculations.

### References

Alexander, C.J. (2006). Spectral Analysis of Spatial Point Patterns in Complex Study Regions. PhD Thesis, Open University.

Bartlett, M. S. (1964). The spectral analysis of two-dimensional point processes. Biometrika, 51, 299-311

Mugglestone, M.A. & Renshaw, E. (1996). A practical guide to the spectral analysis of spatial point patterns. Computational Statistics and Data Analysis, 21, 43-65

Directive: `FOURIER`.

Procedures: `DFOURIER`, `MCROSSPECTRUM`, `SMOOTHSPECTRUM`.

Commands for: Spatial statistics.

### Example

```CAPTION        'DPSPECTRALPLOT example'; STYLE=major
VARIATE        [VALUES=10(0.05,0.15...0.95)] xfull
VARIATE        [VALUES=(0.05,0.15...0.95)10] yfull
VARIATE        [VALUES=0.5,0.7,0.7,0.5] xhole
VARIATE        [VALUES=0.5,0.5,0.7,0.7] yhole
VARIATE        [VALUES=0,1,1,0] xpoly
VARIATE        [VALUES=0,0,1,1] ypoly

" exact lattice "
DPSPECTRALPLOT Y=yfull; X=xfull; YPOLYGON=ypoly; XPOLYGON=xpoly;\
PERIODOGRAM=pmat1

" lattice with rectangle of observations missing "
VARIATE        [NVALUES=96] xs,ys
0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.15 0.15 0.15 0.15 0.15
0.15 0.15 0.15 0.15 0.15 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25
0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.35 0.45 0.45 0.45 0.45 0.45
0.45 0.45 0.45 0.45 0.45 0.55 0.55 0.55 0.55 0.55 0.55 0.55 0.55 0.65 0.65
0.65 0.65 0.65 0.65 0.65 0.65 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75 0.75
0.75 0.85 0.85 0.85 0.85 0.85 0.85 0.85 0.85 0.85 0.85 0.95 0.95 0.95 0.95
0.95 0.95 0.95 0.95 0.95 0.95 :
0.05 0.15 0.25 0.35 0.45 0.55 0.65 0.75 0.85 0.95 0.05 0.15 0.25 0.35 0.45
0.55 0.65 0.75 0.85 0.95 0.05 0.15 0.25 0.35 0.45 0.55 0.65 0.75 0.85 0.95
0.05 0.15 0.25 0.35 0.45 0.55 0.65 0.75 0.85 0.95 0.05 0.15 0.25 0.35 0.45
0.55 0.65 0.75 0.85 0.95 0.05 0.15 0.25 0.35 0.45 0.75 0.85 0.95 0.05 0.15
0.25 0.35 0.45 0.75 0.85 0.95 0.05 0.15 0.25 0.35 0.45 0.55 0.65 0.75 0.85
0.95 0.05 0.15 0.25 0.35 0.45 0.55 0.65 0.75 0.85 0.95 0.05 0.15 0.25 0.35
0.45 0.55 0.65 0.75 0.85 0.95 :

DPSPECTRALPLOT Y=ys; X=xs; YPOLYGON=ypoly; XPOLYGON=xpoly;\
PERIODOGRAM=pmat2

" conditional correction "
DPSPECTRALPLOT Y=ys; X=xs; YPOLYGON=ypoly; XPOLYGON=xpoly;\
YHOLEPOLYGON=yhole; XHOLEPOLYGON=xhole; PERIODOGRAM=pmat3

PRINT          pmat1; FIELD=8
PRINT          pmat2; FIELD=8
PRINT          pmat3; FIELD=8
```
Updated on March 8, 2019