Maximum likelihood estimation for the generalized extreme value distribution
Source:R/mle.R
fit.gev.RdThis function returns an object of class mev_gev, with default methods for printing and quantile-quantile plots.
The default starting values are the solution of the probability weighted moments.
Usage
fit.gev(
xdat,
start = NULL,
method = c("nlminb", "BFGS"),
show = FALSE,
fpar = NULL,
warnSE = FALSE
)Arguments
- xdat
a numeric vector of data to be fitted.
- start
named list of starting values
- method
string indicating the outer optimization routine for the augmented Lagrangian. One of
nlminborBFGS.- show
logical; if
TRUE(the default), print details of the fit.- fpar
a named list with optional fixed components
loc,scaleandshape- warnSE
logical; if
TRUE, a warning is printed if the standard errors cannot be returned from the observed information matrix when the shape is less than -0.5.
Value
a list containing the following components:
estimatea vector containing the maximum likelihood estimates.std.erra vector containing the standard errors.vcovthe variance covariance matrix, obtained as the numerical inverse of the observed information matrix.methodthe method used to fit the parameter.nllhthe negative log-likelihood evaluated at the parameterestimate.convergencecomponents taken from the list returned byauglag. Values other than0indicate that the algorithm likely did not converge.countscomponents taken from the list returned byauglag.xdatvector of data
Examples
xdat <- mev::rgev(n = 100)
fit.gev(xdat, show = TRUE)
#> Log-likelihood: -152.4593
#>
#> Estimates
#> loc scale shape
#> -0.193 0.931 0.023
#>
#> Standard Errors
#> loc scale shape
#> 0.1091 0.0823 0.0954
#>
#> Optimization Information
#> Convergence: successful
#> Function Evaluations: 51
#> Gradient Evaluations: 21
#>
# Example with fixed parameter
fit.gev(xdat, show = TRUE, fpar = list(shape = 0))
#> Log-likelihood: -152.4891
#>
#> Estimates
#> loc scale
#> -0.182 0.939
#>
#> Standard Errors
#> loc scale
#> 0.0989 0.0750
#>
#> Parameters
#> loc scale shape
#> -0.182 0.939 0.000
#>
#> Optimization Information
#> Convergence: successful
#> Function Evaluations: 49
#> Gradient Evaluations: 16
#>