fgumbelx: Maximum-likelihood Fitting of the Maximum of Two Gumbel...

fgumbelxR Documentation

Maximum-likelihood Fitting of the Maximum of Two Gumbel Distributions

Description

Maximum-likelihood fitting for the maximum of two gumbel distributions, allowing any of the parameters to be held fixed if desired.

Usage

fgumbelx(x, start, ..., nsloc1 = NULL, nsloc2 = NULL, std.err = TRUE, 
    corr = FALSE, method = "BFGS", warn.inf = TRUE)

Arguments

x

A numeric vector, which may contain missing values.

start

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).

nsloc1

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.

nsloc2

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.

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.

Details

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.

Value

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

estimate

A vector containing the maximum likelihood estimates.

std.err

A vector containing the standard errors.

fixed

A vector containing the parameters of the model that have been held fixed.

param

A vector containing all parameters (optimized and fixed).

deviance

The deviance at the maximum likelihood estimates.

corr

The correlation matrix.

var.cov

The variance covariance matrix.

convergence, counts, message

Components taken from the list returned by optim.

data

The data passed to the argument x.

nsloc1

The argument nsloc1.

nsloc2

The argument nsloc2.

n

The length of x.

call

The call of the current function.

Warning

This function is experimental and involves optimizing over a potentially complex surface.

See Also

fgev, optim, rgumbelx

Examples

uvdata <- rgumbelx(100, loc1 = 0, scale1 = 1, loc2 = 1, scale2 = 1)
fgumbelx(uvdata, loc1 = 0, scale1 = 1)

evd documentation built on Sept. 21, 2024, 9:06 a.m.