Learn R Programming

fExtremes (version 220.10063)

GevGlmFit: Modelling the GEV Distribution including GLM

Description

A collection and description of functions to model the Generalized Extreme Value, GEV, distribution by maximum likelihood approximation based on R's 'ismev' package. In addition to the function gevFit the parameter estimation allows to include generalized linear modelling, GLM, of each parameter. The functions are: ll{ gevglmFit fits empirical or simulated data to the distribution, print print method for a fitted GEV object of class ..., plot plot method for a fitted GEV object, summary summary method for a fitted GEV object, gevglmprofPlot profile log-likelihoods for return levels, gevglmprofxiPlot profile log-likelihoods for shape parameters. }

Usage

gevglmFit(x, y = NULL, gumbel = FALSE, mul = NULL, sigl = NULL, shl = NULL, 
    mulink = identity, siglink = identity, shlink = identity, show = FALSE, 
    method = "Nelder-Mead", maxit = 10000, ...)

## S3 method for class 'gevglmFit':
print(x, \dots)
## S3 method for class 'gevglmFit':
plot(x, which = "ask", \dots)
## S3 method for class 'gevglmFit':
summary(object, doplot = TRUE, which = "all", \dots)

gevglmprofPlot(object, m, xlow, xup, conf = 0.95, nint = 100)
gevglmprofxiPlot(object, xlow, xup, conf = 0.95, nint = 100)

Arguments

conf
[gevglmprof*Plot] - the confidence coefficient of the plotted profile confidence interval.
doplot
a logical. Should the results be plotted?
gumbel
[gevglmFit] - a logical, should a Gumbel fit be created? In this case the shape parameter equals zero, and the arguments shl and and shlink are omitted.
m
[gevglmprofPlot] - the return level; i.e. the profile likelihood is for the value that is exceeded with probability 1/m.
maxit
[gevglmFit] - the maximum number of iterations.
method
[gevglmFit] - the optimization method (see optim for details).
mul, sigl, shl
[gevglmFit] - numeric vectors of integers, giving the columns of ydat that contain covariates for generalized linear modelling of the location, scale and shape parameters repectively (or NULL (the defa
mulink, siglink, shlink
[gevglmFit] - inverse link functions for generalized linear modelling of the location, scale and shape parameters repectively.
nint
[gevglmprof*Plot] - the number of points at which the profile likelihood is evaluated.
object
[summary][grlevelPlot] - a fitted object of class "gevglmFit".
show
[gevglmFit] - a logical; if TRUE (the default), print details of the fit.
x
[gevglmFit] - a numeric vector of data to be fitted. [print][plot] - a fitted object of class "gevglmFit".
xlow, xup
[gevglmprof*Plot] - the least and greatest value at which to evaluate the profile likelihood.
y
[gevglmFit] - a matrix of covariates for generalized linear modelling of the parameters (or NULL (the default) for stationary fitting). The number of rows should be the same as the length of xdat.
which
[plot][summary] - a vector of logicals, one for each plot, denoting which plot should be displayed.
...
[gevglmFit] - control parameters optionally passed to the optimization function. Parameters for the optimization function are passed to components of the control argument of optim. [plot][s

Value

  • gevglmFit returns a list containing the following components. A subset of these components are printed after the fit. If show is TRUE, then assuming that successful convergence is indicated, the components nllh, mle and se are always printed.
  • transan logical indicator for a non-stationary fit.
  • modela list with components mul, sigl and shl.
  • linka character vector giving inverse link functions.
  • convthe convergence code, taken from the list returned by optim. A zero indicates successful convergence.
  • nllhthe negative logarithm of the likelihood evaluated at the maximum likelihood estimates.
  • datathe data that has been fitted. For non-stationary models, the data is standardized.
  • mlea vector containing the maximum likelihood estimates.
  • covthe covariance matrix.
  • sea vector containing the standard errors.
  • valsa matrix with three columns containing the maximum likelihood estimates of the location, scale and shape parameters at each data point.
  • For stationary models four plots are produced; a probability plot, a quantile plot, a return level plot and a histogram of data with fitted density. For non-stationary models two plots are produced; a residual probability plot and a residual quantile plot. gevglmprofPlot gevglmprofxiPlot a plot of the profile likelihood is produced, with a horizontal line representing a profile confidence interval with confidence coefficient conf.

Details

Simulation: To simulate a GEV series use the function gevSim. Parameter Estimation: gevglmFit fits by the Maximum-likelihood approach the generalized extreme value distribution, including generalized linear modelling of each parameter. Methods: print.gevglm, plot.gevglm and summary.gevglm are print, plot, and summary methods for a fitted object of class gevglmFit. Profile Likelihood: gevglmprofPlot and gevglmprofxiPlot produce profile log-likelihoods for shape parameters and m year/block return levels for stationary GEV models using the output of the function gevFit. Nonstationary Models: For non-stationary fitting it is recommended that the covariates within the generalized linear models are (at least approximately) centered and scaled (i.e. the columns of ydat should be approximately centered and scaled).

References

Coles S. (2001); Introduction to Statistical Modelling of Extreme Values, Springer.

Examples

Run this code
## SOURCE("fExtremes.54A-ExtremesGlm")

## Simulated GEV Data:
   xmpExtremes("Start: Simulte GEV Sample >")
   x = gevSim(model = list(shape = 0.25, location = 0, scale = 1), n = 1000)
   par(mfrow = c(2, 2))
   plot(x, main = "Simulated GEV Data")
   # Fit GEV Data:
   fit = gevglmFit(x) 
   print(fit)
   # Summarize Results:
   summary(fit, which = c(TRUE, TRUE, TRUE, FALSE))
   
## Simulated GEV Data:
   xmpExtremes("Next: Estimate Parameters >")
   ##> x = gevSim(model = list(shape = 0, location = 0, scale = 1), n = 1000)
   ##> par(mfrow = c(2, 2))
   ##> plot(x, main = "Simulated Gumbel Data")
   # Fit GEV Data:
   ##> fit = gevglmFit(x, gumbel = TRUE) 
   ##> print(fit)
   # Summarize Results:
   ##> summary(fit, which = c(TRUE, TRUE, TRUE, FALSE))
   
## Portpirie Data:
   xmpExtremes("Next: Fit Portpirie Data >")
   par(mfrow = c(2, 1))
   data(portpirie)
   fit = gevglmFit(portpirie[, 2])
   gevglmprofPlot(fit, m = 10, 4.1, 5)
   title(main = "Portpirie")
   gevglmprofxiPlot(fit, -0.3, 0.3)
   title(main = "Portpirie")
   
## Interactive Plot:
   ##> par(mfrow = c(2, 2))
   ##> plot(fit)

Run the code above in your browser using DataLab