gevcvd.fit: Maximum Likelihood Fitting for the GEV distribution - CV...

gevcvd.fitR Documentation

Maximum Likelihood Fitting for the GEV distribution - CV model

Description

Maximum-likelihood fitting for the generalized extreme value distribution, including generalized linear modelling of each parameter. The function differs from gevd.fit because it uses a different parametrisation of the distribution based on the \tau, the ratio of the scale parameter and the location parameter, which is a monotonic function of the coefficient of variation. This means that when regression models are applied for the location, these also affect the scale. The function allows any parameter to be kept fixed and to not be estimated.

Usage

gevcvd.fit(
  xdat,
  ydat = NULL,
  mul = NULL,
  taul = NULL,
  shl = NULL,
  mulink = identity,
  taulink = identity,
  shlink = identity,
  muinit = NULL,
  tauinit = NULL,
  shinit = NULL,
  show = TRUE,
  method = "Nelder-Mead",
  optimPars = NULL,
  maxit = 10000,
  fixedPars = list(mu = NULL, tau = NULL, sh = NULL),
  ...
)

Arguments

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)

taul

As mul for the tau parameter

shl

As mul for the shape parameter

mulink

the link function for the location parameter - default to identity

taulink

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

tauinit

initial values for the tau parameter

shinit

initial values for the shape parameter

show

Logical; if TRUE (the default), print details of the fit.

method

The optimization method (see optim for details)

optimPars

A string with other parameters to pass into optim. For example, depending on method, one could have "lower = 10, upper = 20"

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 NULL its value is estimated.

...

Other control parameters for the optimization. These are passed to components of the control argument of optim.

Value

An object of the gevcd.fit class, similar to gev.fit objects obtained using ismev::gev.fit. The ismev functions for gev.fit will not work on these objects.

In the output the vals matrix gives the location and scale values obtained as scale = \tau * location.

Examples

set.seed(12)
x <- runif(500)
y <- rgev(500,loc = 40+4*x, scale = 0.2*(40+4*x), sh = 0.15)
fit1 <- gevcvd.fit(y, show=FALSE)
fit1
## now add a regression model for the location
fit2 <- gevcvd.fit(y, ydat = cbind(x), mul=1, show=FALSE)
fit2
## now a fit with a fixed tau parameter
fitf <- gevcvd.fit(y, ydat = cbind(x), mul=1, show=FALSE, fixedPars = list(tau = 0.2))
fitf ## only two parameters are estimated (location and shape)

ilapros/ilaprosUtils documentation built on April 6, 2023, 4:44 a.m.