extRemes | R Documentation |
S3 alogLik
method to perform loglikelihood adjustment for fitted
extreme value model objects returned from the function
fevd
in the
extRemes
package.
The model must have been fitted using maximum likelihood estimation.
## S3 method for class 'fevd'
alogLik(x, cluster = NULL, use_vcov = TRUE, ...)
x |
A fitted model object with certain associated S3 methods. See Details. |
cluster |
A vector or factor indicating from which cluster the
respective log-likelihood contributions from If |
use_vcov |
A logical scalar. Should we use the |
... |
Further arguments to be passed to the functions in the
sandwich package |
See alogLik
for details.
An object inheriting from class "chandwich"
. See
adjust_loglik
.
class(x)
is a vector of length 5. The first 3 components are
c("lax", "chandwich", "extRemes")
.
The remaining 2 components depend on the model that was fitted.
The 4th component is: "gev"
if x$type = "GEV"
or
x$type = "Gumbel"
; "gp"
if x$type = "GP"
or
x$type = "Exponential"
; "pp"
if x$type = "PP"
.
The 5th component is
"stat"
if is.fixedfevd = TRUE
and
"nonstat"
if is.fixedfevd = FALSE
.
Chandler, R. E. and Bate, S. (2007). Inference for clustered data using the independence loglikelihood. Biometrika, 94(1), 167-183. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/biomet/asm015")}
Suveges, M. and Davison, A. C. (2010) Model misspecification in peaks over threshold analysis, The Annals of Applied Statistics, 4(1), 203-221. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/09-AOAS292")}
Zeileis (2006) Object-Oriented Computation and Sandwich Estimators. Journal of Statistical Software, 16, 1-16. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v016.i09")}
alogLik
: loglikelihood adjustment for model fits.
# We need the extRemes and distillery packages
got_extRemes <- requireNamespace("extRemes", quietly = TRUE)
got_distillery <- requireNamespace("distillery", quietly = TRUE)
if (got_extRemes & got_distillery) {
library(extRemes)
library(distillery)
# Examples from the extRemes::fevd documentation
data(PORTw)
# GEV
fit0 <- fevd(TMX1, PORTw, units = "deg C", use.phi = TRUE)
adj_fit0 <- alogLik(fit0)
summary(adj_fit0)
# GEV regression
fitPORTstdmax <- fevd(TMX1, PORTw, scale.fun = ~STDTMAX, use.phi = TRUE)
adj_fit1 <- alogLik(fitPORTstdmax)
summary(adj_fit1)
fitPORTstdmax2 <- fevd(TMX1, PORTw, location.fun = ~STDTMAX,
scale.fun = ~STDTMAX, use.phi = TRUE)
adj_fit2 <- alogLik(fitPORTstdmax2)
summary(adj_fit2)
anova(adj_fit0, adj_fit1)
anova(adj_fit1, adj_fit2)
anova(adj_fit0, adj_fit2)
anova(adj_fit0, adj_fit1, adj_fit2)
# Gumbel
fit0 <- fevd(TMX1, PORTw, type = "Gumbel", units = "deg C")
adj_fit0 <- alogLik(fit0)
summary(adj_fit0)
# GP
data(damage)
fit1 <- fevd(Dam, damage, threshold = 6, type = "GP",
time.units = "2.05/year")
adj_fit1 <- alogLik(fit1)
summary(adj_fit1)
# Exponential
fit0 <- fevd(Dam, damage, threshold = 6, type="Exponential",
time.units = "2.05/year")
adj_fit0 <- alogLik(fit0)
summary(adj_fit0)
# GP non-constant threshold
data(Fort)
fit <- fevd(Prec, Fort, threshold = 0.475,
threshold.fun = ~I(-0.15 * cos(2 * pi * month / 12)),
type = "GP")
adj_fit <- alogLik(fit)
summary(adj_fit)
# Exponential non-constant threshold
fit <- fevd(Prec, Fort, threshold = 0.475,
threshold.fun = ~I(-0.15 * cos(2 * pi * month / 12)),
type = "Exponential")
adj_fit <- alogLik(fit)
summary(adj_fit)
# PP model
fit <- fevd(Prec, Fort, threshold = 0.475, type = "PP", units = "inches")
adj_fit <- alogLik(fit)
summary(adj_fit)
# PP non-constant threshold
fit <- fevd(Prec, Fort, threshold = 0.475,
threshold.fun=~I(-0.15 * cos(2 * pi * month / 12)),
type = "PP")
adj_fit <- alogLik(fit)
summary(adj_fit)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.