Description Usage Arguments Details Value References Examples
Regression modelling with a Generalized Extreme value response distribution
and generalized linear modelling of each parameter, specified by a symbolic
description of each linear predictor and the inverse link function to be
applied to each linear predictor. Models are fitted using maximum
likelihood estimation using the optim
function.
1 2 3 4 |
y |
Either a numeric vector or the name of a variable in |
data |
An optional data frame containing |
mu, sigma, xi |
Formulae (see |
mustart, sigmastart, xistart |
Optional numeric vectors specifying
respective initial values for the parameters relating to location,
scale and shape. If not supplied these are set inside the
|
mulink, sigmalink, xilink |
Functions giving the respective
link functions that relate the location, scale and
shape parameters to the linear predictor, for example
|
invmulink, invsigmalink, invxilink |
Functions giving the respective
inverse link functions that relate the location, scale and
shape parameters to the linear predictor. If these are supplied then
the code does not check that they are consistent with the link
functions supplied in |
optim_control |
A list to be passed to |
scale_covs |
A logical scalar. Should we center and scale the
covariate data before minmizing the negated log-likelihood using
|
... |
further arguments to be passed to |
Fitting a GEV regression model allows us to relex the stationary assumption. The function fits a GEV regression modelling using maximum likelihood estimation with a focus on univariate response variable. Covaraite effects are allowed by including generalized linear modelling of each parameter.
The default for scale_covs
is FALSE
. A classic case when a
model fit may fail under this setting is when calendar year is a covariate.
This covariate will tend to be orders of magnitude larger than other
covariates, which causes numerical optimisation problems. A solution is
to use scale_covs = TRUE
. However, it may be better to shift/scale
the calendar year prior to calling gevreg
in order to give the
intercept of the model a more useful interpretation. Otherwise, the
intercept corresponds to the year 0, which is unlikely to be of interest.
An object (list) of class c("gev", "evreg")
, which has
the following components
coefficients |
A named numeric vector of the estimates of the model parameters. |
se |
estimated standard errors |
Chandler, R. E. and Bate, S. (2007). Inference for clustered data using the independence loglikelihood. Biometrika, 94(1), 167-183. http://dx.doi.org/10.1093/biomet/asm015
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ### Oxford-Worthing temperature data
## Estimate separate GEV parameters for for Oxford and Worthing,
## as in Chandler and Bate (2007)
# Intercepts are Oxford-Worthing average
ow1 <- gevreg(temp, data = ow, mu = ~ loc, sigma = ~ loc,
xi = ~ loc, sigmalink = identity)
# Intercepts relate to Oxford
ow2 <- gevreg(temp, data = ow, mu = ~ factor(name), sigma = ~ factor(name),
xi = ~ factor(name), sigmalink = identity)
### Fremantle sea levels
## No covariates
f0 <- gevreg(SeaLevel, data = evreg::fremantle)
## Add SOI as a covariate
f1 <- gevreg(SeaLevel, data = evreg::fremantle, mu = ~ SOI)
## Add (shited and scaled) year as a covariate (instead)
f2 <- gevreg(SeaLevel, data = evreg::fremantle, mu = ~ Year01)
# Include both SOI and year
f3 <- gevreg(SeaLevel, data = evreg::fremantle, mu = ~ Year01 + SOI)
summary(f3)
f3b <- gevreg(SeaLevel, data = evreg::fremantle, mu = ~ Year01 + SOI,
scale_covs = TRUE)
summary(f3b)
f3c <- gevreg(SeaLevel, data = evreg::fremantle, mu = ~ Year + SOI,
scale_covs = TRUE)
summary(f3c)
# (Note: this fit fails if scale_covs = FALSE)
# Example of user-supplied link
f3 <- gevreg(SeaLevel, data = evreg::fremantle, mu = ~ Year01 + SOI,
mulink = function(x) x, invmulink = function(x) x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.