fGEV: Fitting of the Generalized Extreme Value Distribution

View source: R/fGEV.R

fGEVR Documentation

Fitting of the Generalized Extreme Value Distribution

Description

Maximum-likelihood and Metropolis-Hastings algorithm for the estimation of the generalized extreme value distribution.

Usage

fGEV(data, par.start, method="Frequentist", u, cov, 
     optim.method="BFGS", optim.trace=0, sig0, nsim)

Arguments

data

A vector representing the data, which may contain missing values.

par.start

A vector of length 3 giving the starting values for the parameters to be estimated. If missing, moment estimates are used.

method

A character string indicating whether the estimation is done following a "Frequentist" or "Bayesian" approach.

u

A real indicating a high threshold. If supplied a threshld exceedance approach is taken and computations use the censored likelihood. If missing, a block maxima approach is taken and the regular GEV likelihood is used.

cov

A matrix of covariates to define a linear model for the location parameter.

optim.method

The optimization method to be used. Required when method="Frequentist". See optim for more details.

optim.trace

A non-negative interger tracing the progress of the optimization. Required when method="Frequentist". See optim for more details.

sig0

Positive reals representing the initial value for the scaling parameter of the multivariate normal proposal distribution for both margins. Required when method="Bayesian".

nsim

An integer indicating the number of iterations in the Metropolis-Hastings algorithm. Required when method="Bayesian".

Details

When cov is a vector of ones then the location parameter μ is constant. On the contrary, when cov is provided, it represents the design matrix for the linear model on μ (the number of columns in the matrix indicates the number of linear predictors). When u=NULL or missing, the likelihood function is given by

∏_{i=1}^{n}f(x_i; μ, σ, ξ)

where g(\cdot;μ,σ,ξ) represents the GEV pdf, whereas when a threshold value is set the likelihood is given by

k_n \log≤ft( G(u;μ,σ,ξ) \right) \times ∏_{i=1}^n \frac{\partial}{\partial x}G(x;μ,σ,ξ)|_{x=x_i}

where G(\cdot;μ,σ,ξ) is the GEV cdf and k_n is the empirical estimate of the probability of being greater than the threshold u.

Note that the case ξ<=0 is not yet considered when u is considered.

The choice method="Bayesian" applies a random walk Metropolis-Hastings algorithm as described in Section 3.1 and Step 1 and 2 of Algorithm 1 from Beranger et al. (2021). The algorithm may restart for several reasons including if the proposed value of the parameters changes too much from the current value (see Garthwaite et al. (2016) for more details.)

The choice method="Frequentist" uses the optim function to find the maximum likelihood estimator.

Value

When method="Frequentist" the routine returns a list including the parameter estimates (est) and associated variance-covariance matrix (varcov) and standard errors (stderr). When method="Bayesian" the routine returns a list including

  • param_postthe parameter posterior sample;

  • accepteda binary vector indicating which proposal was accepted;

  • straight.rejecta binary vector indicating which proposal were rejected straight away given that the proposal is a multivariate normal and there are conditions on the parameter values;

  • nsimthe number of simulations in the algorithm;

  • sig.vecthe vector of updated scaling parameter in the multivariate normal porposal distribution at each iteration;

  • sig.restartthe value of the scaling parameter in the multivariate normal porposal distribution when the algorithm needs to restart;

  • acc.veca vector of acceptance probabilities at each iteration.

Author(s)

Simone Padoan, simone.padoan@unibocconi.it, https://faculty.unibocconi.it/simonepadoan/; Boris Beranger, borisberanger@gmail.com https://www.borisberanger.com;

References

Beranger, B., Padoan, S. A. and Sisson, S. A. (2021). Estimation and uncertainty quantification for extreme quantile regions. Extremes, 24, 349-375.

Garthwaite, P. H., Fan, Y. and Sisson S. A. (2016). Adaptive optimal scaling of Metropolis-Hastings algorithms using the Robbins-Monro process. Communications in Statistics - Theory and Methods, 45(17), 5098-5111.

See Also

dGEV

Examples


##################################################
### Example - Pollution levels in Milan, Italy ###
##################################################

data(MilanPollution)

# Frequentist estimation
fit <- fGEV(Milan.winter$PM10)
fit$est

# Bayesian estimation with high threshold
cov <- cbind(rep(1,nrow(Milan.winter)), Milan.winter$MaxTemp, 
             Milan.winter$MaxTemp^2)
u <- quantile(Milan.winter$PM10, prob=0.9, type=3, na.rm=TRUE)
if(interactive()){
  fit2 <- fGEV(data=Milan.winter$PM10, par.start=c(50,0,0,20,1), 
               method="Bayesian", u=u, cov=cov, sig0=0.1, nsim=5e+4) 
}

ExtremalDep documentation built on March 7, 2023, 3:16 p.m.