neutral_hotspots: neutral_hotspots

Description Usage Arguments Value See Also Examples

Description

Implements neutral model of hotspot values and associated autocorrelation statustics. Current version is a simply internal R loop, while neutral_hotspots_ntests is a parallel version of exactly the same thing.

Usage

1
2
neutral_hotspots(nbs, wts, alpha = 0.1, sd0 = 0.1, ac_type = "moran",
  niters = 1, log_scale = TRUE, ntests = 100, parallel = FALSE, seed)

Arguments

nbs

An spdep nb object listing all neighbours of each point

wts

Weighting factors for each neighbour; must have same length as nbs. Uniform weights used if not given.

alpha

strength of spatial autocorrelation

sd0

Standard deviation of truncated normal distribution used to model environmental variation (with mean of 1)

ac_type

Type of autocorrelation statistic to use in tests (moran, geary, or getis-org=go)

niters

Number of successive layers of spatial autocorrelation

log_scale

If TRUE, raw hotspot values are log-transformed

ntests

Number of tests over which to generate an average result

parallel

If true, the tests are conducted using the R package parallel, otherwise using (non-parallel) codeRcpp loops.

seed

Random seed

Value

A vector of hotspot values sorted from high to low

See Also

ives

Examples

1
2
3
4
5
6
# First set up a grid of rectangular neighbours
size <- 10
xy <- cbind (rep (seq (size), each=size), rep (seq (size), size))
dhi <- 1 # for rook; dhi=1.5 for queen
nbs <- spdep::dnearneigh (xy, 0, dhi)
dat <- neutral_hotspots (nbs, ntests=1000)

mpadge/hotspotr documentation built on May 23, 2019, 6:23 a.m.