spline.correlog2D: Anisotropic nonparametric (cross-)correlation function for...

View source: R/spline-correlog2D.R

spline.correlog2DR Documentation

Anisotropic nonparametric (cross-)correlation function for univariate spatial data

Description

spline.correlog2D is the function to estimate the anisotropic nonparametric correlation function in 8 (or arbitrary) directions (North - Southeast) for univariate data. Correlation functions are calculated for each different bearing. The function assumes univariate observations at each location. (use Sncf2D otherwise).

Usage

spline.correlog2D(
  x,
  y,
  z,
  w = NULL,
  df = NULL,
  type = "boot",
  resamp = 1000,
  npoints = 300,
  save = FALSE,
  max.it = 25,
  xmax = FALSE,
  na.rm = FALSE,
  jitter = FALSE,
  quiet = FALSE,
  angle = c(0, 22.5, 45, 67.5, 90, 112.5, 135, 157.5)
)

Arguments

x

vector of length n representing the x coordinates.

y

vector of length n representing the y coordinates.

z

vector of length n representing the observation at each location.

w

an optional second vector of length n for variable 2 (to estimate spatial or lagged cross-correlation functions).

df

degrees-of-freedom for the spline. Default is sqrt(n).

type

takes the value "boot" (default) to generate a bootstrap distribution or "perm" to generate a null distribution for the estimator

resamp

the number of resamples for the bootstrap or the null distribution.

npoints

the number of points at which to save the value for the spline function (and confidence envelope / null distribution).

save

If TRUE, the whole matrix of output from the resampling is saved (an resamp x npoints dimensional matrix).

max.it

the maximum iteration for the Newton method used to estimate the intercepts.

xmax

If FALSE, the max observed in the data is used. Otherwise all distances greater than xmax is omitted.

na.rm

If TRUE, NA's will be dealt with through pairwise deletion of missing values for each pair of time series – it will dump if any one pair has less than two (temporally) overlapping observations.

jitter

If TRUE, jitters the distance matrix to avoid problems associated with fitting the function to data on regular grids.

quiet

If TRUE, the counter is suppressed during execution.

angle

specifies number of cardinal directions and angles for which to calculate correlation functions. Default are 8 directions between 0 and 180.

Details

see Sncf2D

Value

An object of class "Sncf2D" is returned. See Sncf2D for details.

Note

The function to estimate the UNIvariate anisotropic nonparametric (cross-)correlation function in arbitrary directions. In particular it was developed to calculate the univariate lagged cross-correlation function used in (Humston et al. 2005). Note that this 2D spline correlogram does the anisotropic analysis NOT by doing the angle-with-tolerance-wedge-style of Oden and Sokal (1986) but by projecting the the spatial coordinates of all locations on a sequence of cardinal angles (a la Sncf2D). Hence, all data points are used every time, it is only their relative distances that are changed. For example {0, 0} and {0, 10} are distance zero in the zero-degree direction but at distance 10 in the 90-degree direction.

References

Oden, N.L. and Sokal, R.R. 1986. Directional autocorrelation: an extension of spatial correlograms to two dimensions. Systematic Zoology 35: 608-617. <doi:10.2307/2413120> @references Humston, R., Mortensen, D. and Bjornstad, O.N. 2005. Anthropogenic forcing on the spatial dynamics of an agricultural weed: the case of the common sunflower. Journal of Applied Ecology 42: 863-872. <doi:10.1111/j.1365-2664.2005.01066.x>

See Also

Sncf2D


ncf documentation built on May 7, 2022, 5:05 p.m.