gevd.fit | R Documentation |
Maximum-likelihood fitting for the generalized extreme value distribution,
including generalized linear modelling of each parameter.
This function has the same structure as the gev.fit
from ismev
.
Additionally it allows any parameter to be kept fixed and to not be estimated.
gevd.fit(
xdat,
ydat = NULL,
mul = NULL,
sigl = NULL,
shl = NULL,
mulink = identity,
siglink = identity,
shlink = identity,
muinit = NULL,
siginit = NULL,
shinit = NULL,
show = TRUE,
method = "Nelder-Mead",
optimPars = NULL,
maxit = 10000,
fixedPars = list(mu = NULL, sig = NULL, sh = NULL),
...
)
xdat |
A numeric vector of data to be fitted |
ydat |
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 |
mul |
Numeric vectors of integers, giving the columns of ydat that contain covariates for generalized linear modelling of the location parameter (or NULL (the default) if the corresponding parameter is stationary) |
sigl |
As |
shl |
As |
mulink |
the link function for the location parameter - default to identity |
siglink |
the link function for the scale parameter - default to identity |
shlink |
the link function for the shape parameter - default to identity |
muinit |
initial values for the location parameter |
siginit |
initial values for the scale parameter |
shinit |
initial values for the shape parameter |
show |
Logical; if |
method |
The optimization method (see |
optimPars |
A string with other parameters to pass into |
maxit |
The maximum number of iterations |
fixedPars |
a named list to fix any of the distribution parameter to a given value. When the named parameter is set to |
... |
Other control parameters for the optimization. These are passed to components of the control argument of optim. |
The form of the GEV used is that of Coles (2001) Eq (3.2) - so it is not the same as the one used in dgev. Specifically, positive values of the shape parameter imply a heavy tail, and negative values imply a bounded upper tail.
An object of the gev.fit class as for objects obtained using ismev::gev.fit, so that ismev
functions
for gev.fit work on these objects when no parameter is kept fixed (i.e. fixedPars
is a list of NULL)
Hosking, J.R.M. and Wallis, J.R., 2005. Regional frequency analysis: an approach based on L-moments. Cambridge university press.
Coles, S., 2001. An introduction to statistical modeling of extreme values. London: Springer.
dgev
set.seed(12)
x <- runif(500)
y <- rgev(500,loc = 40+4*x,scale = 6,sh = 0.2)
fit1 <- gevd.fit(y, show=FALSE)
fit1
## now add a regression model for the location
fit2 <- gevd.fit(y, ydat = cbind(x), mul=1, show=FALSE)
fit2
## now a fit with a fixed shape parameter (notice the sign)
fitf <- gevd.fit(y, show=FALSE, fixedPars = list(sh = -0.2))
fitf ## only two parameters are estimated
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.