| WRM {spind} | R Documentation |
Wavelet-revised models (WRMs)
Description
A wavelet-based method to remove spatial autocorrelation in multiple linear regressions. Wavelet transforms are implemented using waveslim (Whitcher, 2005).
Usage
WRM(
formula,
family,
data,
coord,
level = 1,
wavelet = "haar",
wtrafo = "dwt",
b.ini = NULL,
pad = list(),
control = list(),
moran.params = list(),
plot = FALSE,
customize_plot = NULL
)
## S3 method for class 'WRM'
plot(x, ...)
## S3 method for class 'WRM'
summary(object, ...)
## S3 method for class 'WRM'
predict(object, newdata, sm = FALSE, newcoord = NA, ...)
Arguments
formula |
Model formula. Variable names must match variables in |
family |
|
data |
A data frame with variable names that match the variables specified in |
coord |
A matrix of two columns with corresponding cartesian coordinates. Currently only supports integer coordinates. |
level |
An integer specifying the degree of wavelet decomposition
|
wavelet |
Name of wavelet family. |
wtrafo |
Type of wavelet transform. Either |
b.ini |
Initial parameter values. Default is NULL. |
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.
|
plot |
A logical value indicating whether to plot autocorrelation of
residuals by distance bin. NOW DEPRECATED in favor of |
customize_plot |
Additional plotting parameters passed to |
x |
An object of class |
... |
Not used |
object |
An object of class |
newdata |
A data frame containing variables used to make predictions. |
sm |
Logical. Should part of smooth components be included? |
newcoord |
New coordinates corresponding to observations in |
Details
WRM can be used to fit linear models for response vectors of different
distributions: gaussian, binomial, or poisson.
As a spatial model, it is a generalized linear model in which the residuals
may be autocorrelated. It corrects for 2-dimensional residual
autocorrelation for regular gridded data sets using the wavelet
decomposition technique. The grid cells are assumed to be square.
Furthermore, this function requires that all predictor variables
be continuous.
Value
An object of class WRM. This consists of a list with the
following elements:
callCall
formulaModel formula
familyFamily
coordCoordinates used in the model
bEstimate of regression parameters
s.e.Standard errors
zDepending on the
family, either a z or t valuepp-values
fittedFitted values from the model
residPearson residuals
b.smParameter estimates of neglected smooth part
fitted.smFitted values of neglected smooth part
levelSelected level of wavelet decomposition
waveletSelected wavelet
wtrafoSelected wavelet transformation
padzoneSelected padding zone expansion factor
padformSelected matrix padding type
n.effEffective number of observations
AICAkaike information criterion
AICcAIC score corrected for small sample sizes
LogLikLog likelihood of the model
ac.glmAutocorrelation of GLM residuals
ac.wrmAutocorrelation of WRM residuals
b.iniInitial parameter values
controlControl parameters for the fitting process
moran.paramsParameters for calculating Moran's I
padList of parameters for padding wavelet coefficients
plotAn object of class
ggplotcontaining information on the autocorrelation of residuals from the fittedWRMand aGLM
Note
For those interested in multimodel inference approaches, WRM with
level = 1 is identical to mmiWMRR with scale = 1.
Author(s)
Gudrun Carl, Sam Levin
References
Carl, G., Kuehn, I. (2010): A wavelet-based extension of generalized linear models to remove the effect of spatial autocorrelation. Geographical Analysis 42 (3), 323 - 337
Whitcher, B. (2005) Waveslim: basic wavelet routines for one-, two- and three-dimensional signal processing. R package version 1.5.
See Also
mmiWMRR, predict.WRM, summary.WRM,
aic.calc
Examples
data(musdata)
coords <- musdata[,4:5]
## Not run:
mwrm <- WRM(musculus ~ pollution + exposure,
family = "poisson",
data = musdata,
coord = coords,
level = 1)
pred <- predict(mwrm, newdata = musdata)
summary(mwrm)
plot(mwrm)
library(ggplot2)
my_wrm_plot <- mwrm$plot
# increase axis text size
print(my_wrm_plot + ggplot2::theme(axis.text = element_text(size = 15)))
## End(Not run)