Learn R Programming

ExtremalDep (version 1.0.0)

fGEV: 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)

Value

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

  • When method="Bayesian" the routine returns a list including:

    param_post

    the parameter posterior sample;

accepted

a binary vector indicating which proposals were accepted;

straight.reject

a binary vector indicating which proposals were rejected immediately, given that the proposal is multivariate normal and there are constraints on the parameter values;

nsim

the number of simulations in the algorithm;

sig.vec

the vector of updated scaling parameters in the multivariate normal proposal distribution at each iteration;

sig.restart

the value of the scaling parameter in the multivariate normal proposal distribution when the algorithm needs to restart;

acc.vec

a vector of acceptance probabilities at each iteration.

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 threshold 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 integer 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 \(\mu\) is constant. On the contrary, when cov is provided, it represents the design matrix for the linear model on \(\mu\) (the number of columns in the matrix indicates the number of linear predictors).

When u=NULL or missing, the likelihood function is given by $$\prod_{i=1}^{n} g(x_i; \mu, \sigma, \xi)$$ where \(g(\cdot;\mu,\sigma,\xi)\) represents the GEV pdf, whereas when a threshold value is set the likelihood is given by $$k_n \log\left( G(u;\mu,\sigma,\xi) \right) \times \prod_{i=1}^n \frac{\partial}{\partial x}G(x;\mu,\sigma,\xi)|_{x=x_i}$$ where \(G(\cdot;\mu,\sigma,\xi)\) 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 \(\xi \leq 0\) is not yet considered when u is used.

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.

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

Run this code
##################################################
### 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)

# \donttest{
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)
# }

Run the code above in your browser using DataLab