gev_fit: Fit a GEV model

View source: R/gev.R

gev_fitR Documentation

Fit a GEV model

Description

gev_fit is used to fit a Generalised Extreme Value (GEV) linear model. This is a wrapper function, using gev_likfit and gev_grad to obtain parameter estimates via maximum likelihood.

Usage

gev_fit(
  formulas,
  data,
  response,
  rl_n = 100,
  links = list("identity", "exponential", "identity")
)

Arguments

formulas

a list with three elements, all objects of class "formula", for the location, scale and shape parameter in that order. A symbolic description of the model

data

data frame containing all variables listed in formulas

response

the observed maxima corresponding to those variables in data

rl_n

the value of n of which to calculate the return level of period n, if NULL, the return level is not calculated

links

a list with three elements, all strings detailing which link function to use for the location, scale and shape parameter in that order

Details

The formulas object have formulas specified symbolically, of the form ~ predictor1 + predictor2 + ... where both predictor1 and predictor2 are variables in data.

The GEV model is fit by using optim with the BFGS method.

Value

an S3 object of class "gev", containing

loglik

value of the final log-likelihood at the values of par

par

list of maximum likelihood parameter estimates for each GEV distribution parameter

par_se

standard errors of the parameters in par

modX

list of model matrices used for each parameter

link

list of link functions inputted

formula

list of formulae inputted

big_formula

combination of unique elements in all formulae used

data

data frame inputted

response

response vector (observed maxima) inputted


dannyjameswilliams/danielR documentation built on Aug. 20, 2023, 3:25 a.m.