Estimates the location, scale, and shape of a GEV distribution from a
vector of block-maxima observations by maximum likelihood (base optim(),
dependency-free and deterministic given the data).
Usage
fb_gev(y, return_periods = c(10, 50, 100), conf_level = 0.95)Arguments
- y
Numeric vector of block-maxima observations. Must contain at least four finite values.
- return_periods
Numeric vector of return periods (in blocks) at which to report return levels. Defaults to
c(10, 50, 100).- conf_level
Numeric in
(0, 1). The interval level for the parameter summary. Defaults to0.95.
Value
An object of class c("fb_gev_fit", "fb_family_fit"): a list with
estimates (a data.frame of term / estimate / std.error /
conf.low / conf.high), return_levels (a data.frame of
return_period / return_level), method, n_obs, and logLik.
Details
Maximum likelihood maximises the GEV log-likelihood directly, with the scale optimised on the log scale to keep it positive and the standard errors recovered from the observed-information (Hessian) matrix by the delta method on the scale.
Return levels (the level exceeded once per m blocks on average) are
computed from the fitted parameters and reported on fit$return_levels
for the requested return periods.
flexyBayes has no GEV route on either engine yet. INLA has gev and
bgev likelihoods and brms a gen_extreme_value() family. A route
through one of them is planned for a future release.
Examples
set.seed(1)
y <- flexyBayes:::rgev(200L, location = 10, scale = 2, shape = 0.1)
fit <- flexyBayes:::fb_gev(y)
fit$estimates
#> term estimate std.error conf.low conf.high
#> 1 location 10.19181337 0.1453225 9.90698659 10.4766402
#> 2 scale 1.82586952 0.1085912 1.61303475 2.0387043
#> 3 shape 0.08191751 0.0526013 -0.02117914 0.1850142