Sum orientation probability densities

Description

Combine uncertain orientations to show where a group of structures concentrates in azimuth or declination.

Usage

spd(pdf, xrange, normalise = F, .res = 0.01, .cutoff = 1e-05)

Arguments

pdf

A skyscapeR.pdf object created with either az.pdf or coordtrans

xrange

Array of values (min and max) for SPD if different from range of pdf. If given, it overrides .cutoff

normalise

If TRUE, scale the returned density to unit area using trapezoidal integration. Default FALSE leaves the summed density unnormalised.

.res

Resolution with which to output SPD. Default is 0.01 degrees.

.cutoff

When the range is chosen automatically, set summed densities below this threshold to zero. Default 1e-5.

Details

A summed probability density gives each input measurement one density curve. The function linearly interpolates these curves onto one angular grid, assigns zero outside each curve's sampled support and adds their heights point by point. With an automatically chosen range it zeroes summed heights below the cutoff. With an explicit range it retains the calculated heights across that range.

Normalisation takes place after interpolation and any cutoff, over the returned grid. An explicit restricted xrange therefore normalises the retained portion only. Zero-area, nonfinite or negative densities and grids with fewer than two points cannot be normalised and produce an error. Earlier versions divided by the sum of sampled heights. Normalised outputs now have a different scale; on a regular grid with zero endpoint densities, new heights equal old heights divided by .res. Existing saved objects are not converted. Changing resolution can still affect interpolation and truncation accuracy, but the returned trapezoidal area is one.

Value

A skyscapeR.spd list with metadata and a data data frame containing coordinate x (degrees) and density y. Normalised densities have units of inverse degrees.

Validation

The tested sums agreed with independently constructed density sums, and the normalised curves had unit trapezoidal area. See D01 validation in the technical manual.

For two bearings on a shared slope, the D02 comparison of summing before and after transformation gave an integrated absolute density difference of 0.00159 after normalisation. See the D02 check in the technical manual.

Scientific checks

References

Silva, F (2020) A probabilistic framework and significance test for the analysis of structural orientations in skyscape archaeology Journal of Archaeological Science 118, 105138. doi:10.1016/j.jas.2020.105138

See Also

az.pdf, coordtrans, hpdi, randomTest, dec.pdf, modelTest, plot.skyscapeR.spd

Examples

# SPD of azimuths
Az <- az.pdf(az=c(87,93,90,110), unc=3)
s1 <- spd(Az)
plot(s1)
s.norm <- spd(Az, normalise=TRUE)
with(s.norm$data, sum(diff(x) * (head(y,-1) + tail(y,-1))/2)) # 1

# SPD of declinations
hor <- createHor(az=c(0,360), alt=c(0,0), loc=c(35,-8,25)) # flat horizon
Dec <- coordtrans(Az, hor)
s2 <- spd(Dec)
plot(s2)