fit_hotspot_model: fit_hotspot_model

Description Usage Arguments Value Note Examples

Description

Fits a neutral model to an observed series of hotspot values in terms of standard deviation of environmental variables, spatial autocorrelation parameters, and number of iterations of spatial autocorrelation.

Usage

1
2
fit_hotspot_model(z, nbs, wts, ac_type = "moran", ntests = 100,
  verbose = FALSE, plot = FALSE)

Arguments

z

Vector of observed values to be tested

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.

ac_type

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

ntests

Number of repeats of neutral model used to calculate mean rank–scale distribution

verbose

If TRUE, dump progress details to screen

plot

If TRUE, produces a plot of rank–scale distributions

Value

A vector of three values as estimated by the neutral model:

  1. sd0 = standard deviation of normal distribution

  2. alpha = temporal autocorrelation coefficient

  3. niters = number of iterations of spatial autocorrelation

Note

Fitting these neutral models is **not** a standard optimisation problem because the models are very noisy. Although optim with method="SANN" may be used, it often generates extremely large values for alpha (for example, > 10). DEoptim could also be applied, yet in generally does not explore anything useful—if given starting parameters, it will generally remain exactly in that place.

The approach employed here reflects the comment of https://stat.ethz.ch/pipermail/r-help/2015-May/428751.html through simply producing regular series, fitting loess models, and taking the corresponding minima.

Examples

1
2
3
4
5
6
7
8
## Not run: 
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)
z <- runif (length (nbs))
test <- fit_hotspot_model (z=z, nbs=dat$nbs, alpha=0.1, sd=0.1, ntests=100)

## End(Not run)

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