Maximum-likelihood fitting for the maximum of two gumbel distributions, allowing any of the parameters to be held fixed if desired.
fgumbelx(x, start, …, nsloc1 = NULL, nsloc2 = NULL, std.err = TRUE,
corr = FALSE, method = "BFGS", warn.inf = TRUE)
A numeric vector, which may contain missing values.
A named list giving the initial values for the
parameters over which the likelihood is to be maximized.
If start
is omitted the routine attempts to find good
starting values using moment estimators.
Additional parameters, either for the fitted model
or for the optimization function optim
. If parameters
of the model are included they will be held fixed at the
values given (see Examples).
A data frame with the same number of rows as the
length of x
, for linear modelling of the location
parameter of the first Gumbel distribution. This is not
recommended as the model is already complex.
A data frame with the same number of rows as the
length of x
, for linear modelling of the location
parameter of the second Gumbel distribution. This is not
recommended as the model is already complex.
Logical; if TRUE
(the default), the standard
errors are returned.
Logical; if TRUE
, the correlation matrix is
returned.
The optimization method (see optim
for
details).
Logical; if TRUE
(the default), a warning is
given if the negative log-likelihood is infinite when evaluated at
the starting values.
Returns an object of class c("gumbelx","evd")
.
The generic accessor functions fitted
(or
fitted.values
), std.errors
,
deviance
, logLik
and
AIC
extract various features of the
returned object.
The functions profile
and profile2d
are
used to obtain deviance profiles for the model parameters.
The function anova
compares nested models.
The function plot
produces diagnostic plots.
An object of class c("gumbelx","evd")
is a list
containing at most the following components
A vector containing the maximum likelihood estimates.
A vector containing the standard errors.
A vector containing the parameters of the model that have been held fixed.
A vector containing all parameters (optimized and fixed).
The deviance at the maximum likelihood estimates.
The correlation matrix.
The variance covariance matrix.
Components taken from the
list returned by optim
.
The data passed to the argument x
.
The argument nsloc1
.
The argument nsloc2
.
The length of x
.
The call of the current function.
This function is experimental and involves optimizing over a potentially complex surface.
For stationary models the parameter names are loc1
, scale1
,
loc2
and scale2
for the location and scale parameters of
two Gumbel distributions, where loc2
must be greater or equal to
loc1
.
The likelihood may have multiple local optima and therefore may be difficult to fit properly; the default starting values use a moment based approach, however it is recommended that the user specify multiple different starting values and experiment with different optimization methods.
Using non-stationary models with nsloc1 and nsloc2 is not recommended due to the model complexity; the data also cannot be transformed back to stationarity so diagnostic plots will be misleading in this case.
# NOT RUN {
uvdata <- rgumbelx(100, loc1 = 0, scale1 = 1, loc2 = 1, scale2 = 1)
fgumbelx(uvdata, loc1 = 0, scale1 = 1)
# }
Run the code above in your browser using DataLab