multiscale.slice: Slicing a multi-scale density/intensity object

View source: R/multiscale.slice.R

multiscale.sliceR Documentation

Slicing a multi-scale density/intensity object

Description

Takes slices of a multi-scale density/intensity estimate at desired global bandwidths

Usage

multiscale.slice(msob, h0, checkargs = TRUE)

Arguments

msob

An object of class msden giving the multi-scale estimate from which to take slices.

h0

Desired global bandwidth(s); the density/intensity estimate corresponding to which will be returned. A numeric vector. All values must be in the available range provided by msob$h0range; see ‘Details’.

checkargs

Logical value indicating whether to check validity of msob and h0. Disable only if you know this check will be unnecessary.

Details

Davies & Baddeley (2018) demonstrate that once a multi-scale density/intensity estimate has been computed, we may take slices parallel to the spatial domain of the trivariate convolution to return the estimate at any desired global bandwidth. This function is the implementation thereof based on a multi-scale estimate resulting from a call to multiscale.density.

The function returns an error if the requested slices at h0 are not all within the available range of pre-computed global bandwidth scalings as defined by the h0range component of msob.

Because the contents of the msob argument, an object of class msden, are returned based on a discretised set of global bandwidth scalings, the function internally computes the desired surface as a pixel-by-pixel linear interpolation using the two discretised global bandwidth rescalings that bound each requested h0. (Thus, numeric accuracy of the slices is improved with an increase to the dimz argument of the preceding call to multiscale.density at the cost of additional computing time.)

Value

If h0 is scalar, an object of class bivden with components corresponding to the requested slice at h0. If h0 is a vector, a list of objects of class bivden.

Author(s)

T.M. Davies

References

Davies, T.M. and Baddeley A. (2018), Fast computation of spatially adaptive kernel estimates, Statistics and Computing, 28(4), 937-956.

See Also

multiscale.density, bivariate.density

Examples


data(chorley) # Chorley-Ribble data (package 'spatstat')
ch.multi <- multiscale.density(chorley,h0=1,h0fac=c(0.5,2))

available.h0(ch.multi)
ch.slices <- multiscale.slice(ch.multi,h0=c(0.7,1.1,1.6))

par(mfcol=c(2,3)) # plot each density and edge-correction surface
for(i in 1:3) { plot(ch.slices[[i]]$z); plot(ch.slices[[i]]$q) }



tilmandavies/sparr documentation built on March 21, 2023, 11:34 a.m.