scaleWMRR {spind} | R Documentation |
Scaling by wavelet multiresolution regression (WMRR)
Description
scaleWMRR performs a scale-specific regression based on a wavelet multiresolution analysis.
Usage
scaleWMRR(
formula,
family,
data,
coord,
scale = 1,
detail = TRUE,
wavelet = "haar",
wtrafo = "dwt",
b.ini = NULL,
pad = list(),
control = list(),
moran.params = list(),
trace = FALSE
)
Arguments
formula |
With specified notation according to names in data frame. |
family |
|
data |
Data frame. |
coord |
Corresponding coordinates which have to be integer. |
scale |
0 (which is equivalent to GLM) or higher integers possible (limit depends on sample size). |
detail |
Remove smooth wavelets? If |
wavelet |
Type of wavelet: |
wtrafo |
Type of wavelet transform: |
b.ini |
Initial parameter values. Default is |
pad |
A list of parameters for padding wavelet coefficients.
|
control |
A list of parameters for controlling the fitting process.
|
moran.params |
A list of parameters for calculating Moran's I.
|
trace |
A logical value indicating whether to print parameter estimates to the console |
Details
This function fits generalized linear models while taking the
two-dimensional grid structure of
datasets into account. The following error distributions (in
conjunction with appropriate link functions) are allowed: gaussian
,
binomial
, or poisson
. The model provides scale-specific
results for data sampled on a contiguous geographical area. The
dataset is assumed to be regular gridded and the grid cells are
assumed to be square. A function from the package 'waveslim' is used
for the wavelet transformations (Whitcher, 2005).
Furthermore, this function requires that all predictor variables
be continuous.
Value
scaleWMRR returns a list containing the following elements
call
Model call
b
Estimates of regression parameters
s.e.
Standard errors of the parameter estimates
z
Z values (or corresponding values for statistics)
p
p-values for each parameter estimate
df
Degrees of freedom
fitted
Fitted values
resid
Pearson residuals
converged
Logical value whether the procedure converged
trace
Logical. If TRUE:
ac.glm
Autocorrelation of glm.residualsac
Autocorrelation of wavelet.residuals
Author(s)
Gudrun Carl
References
Carl G, Doktor D, Schweiger O, Kuehn I (2016) Assessing relative variable importance across different spatial scales: a two-dimensional wavelet analysis. Journal of Biogeography 43: 2502-2512.
Whitcher, B. (2005) Waveslim: basic wavelet routines for one-, two- and three-dimensional signal processing. R package version 1.5.
See Also
waveslim,mra.2d
Examples
data(carlinadata)
coords <- carlinadata[ ,4:5]
## Not run:
# scaleWMRR at scale = 0 is equivalent to GLM
ms0 <- scaleWMRR(carlina.horrida ~ aridity + land.use,
family = "poisson",
data = carlinadata,
coord = coords,
scale = 0,
trace = TRUE)
# scale-specific regressions for detail components
ms1 <- scaleWMRR(carlina.horrida ~ aridity + land.use,
family = "poisson",
data = carlinadata,
coord = coords,
scale = 1,
trace = TRUE)
ms2 <- scaleWMRR(carlina.horrida ~ aridity + land.use,
family = "poisson",
data = carlinadata,
coord = coords,
scale = 2,
trace = TRUE)
ms3<- scaleWMRR(carlina.horrida ~ aridity + land.use,
family = "poisson",
data = carlinadata,
coord = coords,
scale = 3,
trace = TRUE)
## End(Not run)