residuals.gw {GWRM} | R Documentation |
Extract and Visualize GWRM Model Residuals
Description
residuals is a method which extracts model residuals from "gw"
, commonly returned by gw
function. Optionally, it produces a normal plot with a simulated envelope of the residuals.
Usage
## S3 method for class 'gw'
residuals(
object,
type = "pearson",
rep = 19,
envelope = FALSE,
title = "Simulated Envelope of Residuals",
trace = FALSE,
parallel = TRUE,
ncores = 2,
...
)
Arguments
object |
object of class |
type |
type of residuals to be extracted. Default is |
rep |
number of replications for envelope construction. Default is 19, that is the smallest 95 percent band that can be built. |
envelope |
a logical value to specify if the envelope is required. |
title |
a title for the envelope. |
trace |
if |
parallel |
if |
ncores |
is the number of cores that we use if |
... |
further arguments passed to or from other methods. |
Details
The usual Q-Q plot may show an unsatisfactory pattern of the residuals of a model fitted: then we are led to think that the model is badly specificated. The normal plot with simulated envelope indicates that under the distribution of the response variable the model is OK if only a few points fall off the envelope.
Value
Residuals values and plot
Examples
data(goals)
set.seed(1)
fit0 <- gw(goals ~ position, data = goals[sample(1:nrow(goals), 75), ])
residuals(fit0, type = "pearson", rep = 19, envelope = TRUE, trace = FALSE, ncores = 2)