Learn R Programming

evd (version 1.2-3)

fgev: Maximum-likelihood Fitting of the Generalized Extreme Value Distribution

Description

Maximum-likelihood fitting for the generalized extreme value distribution, including linear modelling of the location parameter, and allowing any of the parameters to be held fixed if desired.

Usage

fgev(x, start, ..., nsloc = NULL, std.err = TRUE, corr = FALSE, method
= "Nelder-Mead", warn.inf = TRUE)

Arguments

x
A numeric vector, which may contain missing values.
start
A named list giving the parameters to be optimized with initial values (see Details). If start is omitted the routine attempts to find good starting values using moment estimators.
...
Additional parameters, either for the distribution or for optim. If parameters of the distribution are included they will be held fixed (see Details).
nsloc
A data frame with the same number of rows as the length of x, for linear modelling of the location parameter (see Details). The data frame is treated as a covariate matrix (excluding the intercept). A numeric vector
std.err
Logical; if TRUE (the default), the ``standard errors'' are returned.
corr
Logical; if TRUE, the ``correlation matrix'' is returned.
method
The optimization method (see optim for details).
warn.inf
Logical; if TRUE (the default), a warning is given if the negative log-likelihood is infinite when evaluated at the starting values.

Value

  • Returns an object of class "evd".

    The generic accessor functions fitted (or fitted.values), std.errors and deviance extract various features of the returned object.

    The functions profile and profile2d are used to obtain deviance profiles. The function anova compares nested models. The function plot produces diagnostic plots. An object of class "evd" is a list containing at most the following components

  • estimateA vector containing the maximum likelihood estimates.
  • std.errA vector containing the ``standard errors''.
  • fixedA vector containing the parameters that have been set to fixed values within the optimization.
  • paramA vector containing all parameters (optimized and fixed).
  • devianceThe deviance at the maximum likelihood estimates.
  • corrThe ``correlation matrix''.
  • convergence,counts,messageComponents taken from the list returned by optim.
  • callThe call of the current function.
  • dataThe data passed to the argument x.
  • tdataThe data, transformed to stationarity (for non-stationary models).
  • nslocThe argument nsloc.
  • nThe length of x.
  • modelA character string describing the fitted model.

Details

Maximization of the log-likelihood is performed. The ``standard errors'' and the ``correlation matrix'' in the returned object are taken from the observed information, calculated by a numerical approximation. They must be interpreted with caution because the usual asymptotic properties of maximum likelihood estimators may not hold (Smith, 1985). For stationary fitting, the parameters can be passed (either as named components of start or as fixed values) using loc, scale and shape.

For non-stationary fitting, the non-stationary parameters can be passed using the column names of the data frame nsloc with the prefix ``loc''. The intercept of the linear model can be passed as loc. If nsloc1 is a vector it is converted into a one column data frame with column name ``trend'', so that the associated parameter can be passed as loctrend.

For non-stationary fitting it is recommended that the covariates within the linear model for the location parameter are (at least approximately) centered and scaled, particularly if automatic starting values are used, since the starting values for all the associated parameters are taken to be zero.

References

Smith, R. L. (1985) Maximum likelihood estimation in a class of non-regular cases. Biometrika, 72, 67--90.

See Also

anova.evd, optim, plot.evd, profile.evd, profile2d.evd

Examples

Run this code
uvdata <- rgev(100, loc = 0.13, scale = 1.1, shape = 0.2)
trend <- (-49:50)/100
M1 <- fgev(uvdata, nsloc = trend, control = list(trace = 1))
M2 <- fgev(uvdata)
M3 <- fgev(uvdata, shape = 0)
M4 <- fgev(uvdata, scale = 1, shape = 0)
anova(M1, M2, M3, M4)
plot(M2)
M2P <- profile(M2)
plot(M2P)
rnd <- runif(100, min = -.5, max = .5)
fgev(uvdata, nsloc = data.frame(trend = trend, random = rnd))
fgev(uvdata, nsloc = data.frame(trend = trend, random = rnd), locrandom = 0)

Run the code above in your browser using DataLab