Generalised Residuals for a TVGEV model.

# S3 method for TVGEV
residuals(object, type = c("exp", "unif", "gumbel"), ...)

Arguments

object

A TVGEV object.

type

The approximate distribution wanted. The choices c("unif", "exp", "gumbel") correspond to the standard uniform, the standard exponential and the standard Gumbel distributions. Partial matching is allowed.

...

Not used yet.

Value

A vector of generalised residuals which should approximately be independent and approximately

follow the standard exponential or the uniform distribution, depending on the value of type.

Note

The upper 95% quantile of the standard exponential is close to \(3\) which can be used to gauge "large residuals". Using type = "gumbel" seems better to diagnose abnormally small residuals as may result from abnormally small block maxima.

References

Cox, D.R. and Snell E.J. (1968) "A General Definition of Residuals". JRSS Ser. B, 30(2), pp. 248-275.

Panagoulia, D. and Economou, P. and Caroni, C. (2014) "Stationary and Nonstationary Generalized Extreme Value Modelling of Extreme Precipitation over a Mountainous Area under Climate Change". Environmetrics 25(1), pp. 29-43.

Examples

df <- within(TXMax_Dijon, Date <- as.Date(sprintf("%4d-01-01", Year)))
tv <- TVGEV(data = df, response = "TXMax", date = "Date",
            design = breaksX(date = Date, breaks = "1970-01-01", degree = 1),
            loc = ~ t1 + t1_1970)
e <- resid(tv)
plot(e)

## ggplot alternative
autoplot(e)
#> Warning: Removed 3 rows containing missing values (`geom_line()`).
#> Warning: Removed 9 rows containing missing values (`geom_point()`).

## plot the residual against the fitted location. Use 'as.numeric'
## on the residuals to build a similar ggplot
mu <- tv$theta[ , "loc"]
plot(mu, e, type = "p", pch = 16, col = "darkcyan",
     main = "generalised residuals against 'loc'")