fGEV {ExtremalDep} | R 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 |
method |
A character string indicating whether the estimation is done following a |
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 |
optim.trace |
A non-negative interger tracing the progress of the optimization. Required when |
sig0 |
Positive reals representing the initial value for the scaling parameter of the multivariate normal proposal distribution for both margins. Required when |
nsim |
An integer indicating the number of iterations in the Metropolis-Hastings algorithm. Required when |
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<=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_post
the parameter posterior sample;accepted
a binary vector indicating which proposal was accepted;straight.reject
a 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;nsim
the number of simulations in the algorithm;sig.vec
the vector of updated scaling parameter in the multivariate normal porposal distribution at each iteration;sig.restart
the value of the scaling parameter in the multivariate normal porposal distribution when the algorithm needs to restart;acc.vec
a 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
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)
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)