Functions

Parameter estimation

Extremes.gevfitFunction
gevfit()

Estimate the GEV parameters by maximum likelihood.

Implementation

The function uses Nelder-Mead solver implemented in the Optim.jl package to find the point where the log-likelihood is maximal.

The GEV parameters can be modeled as function of covariates as follows:

\[μ = X₁ × β₁,\]

\[ϕ = X₂ × β₂,\]

\[ξ = X₃ × β₃.\]

The covariates are standardized before estimating the parameters to help fit the model. They are transformed back on their original scales before returning the fitted model.

See also gevfit for the other methods, gevfitpwm, gevfitbayes and BlockMaxima.

source
Extremes.gevfitMethod
gevfit(model::{BlockMaxima{GeneralizedExtremeValue}}, initialvalues::Vector{<:Real})

Estimate the parameters of the BlockMaxima model using the given initialvalues.

source
Extremes.gevfitMethod
gevfit(df::DataFrame,
    datacol::Symbol,
    locationcovid = Vector{Symbol}(),
    logscalecovid = Vector{Symbol}(),
    shapecovid = Vector{Symbol}()
    )

Estimate the GEV parameters.

Arguments

  • df::DataFrame: The dataframe containing the data.
  • datacol::Symbol: The symbol of the column of df containing the block maxima data.
  • initialvalues::Vector{<:Real}: Vector of parameters initial values.
  • locationcovid::Vector{Symbol} = Vector{Symbol}(): The symbols of the columns of df containing the covariates of the location parameter.
  • logscalecovid::Vector{Symbol} = Vector{Symbol}(): The symbols of the columns of df containing the covariates of the log-scale parameter.
  • shapecovid::Vector{Symbol} = Vector{Symbol}(): The symbols of the columns of df containing the covariates of the shape parameter.
source
Extremes.gevfitMethod
gevfit(df::DataFrame,
    datacol::Symbol,
    locationcovid = Vector{Symbol}(),
    logscalecovid = Vector{Symbol}(),
    shapecovid = Vector{Symbol}()
    )

Estimate the GEV parameters.

Arguments

  • df::DataFrame: The dataframe containing the data.
  • datacol::Symbol: The symbol of the column of df containing the block maxima data.
  • locationcovid::Vector{Symbol} = Vector{Symbol}(): The symbols of the columns of df containing the covariates of the location parameter.
  • logscalecovid::Vector{Symbol} = Vector{Symbol}(): The symbols of the columns of df containing the covariates of the log-scale parameter.
  • shapecovid::Vector{Symbol} = Vector{Symbol}(): The symbols of the columns of df containing the covariates of the shape parameter.
source
Extremes.gevfitMethod
gevfit(y,
    initialvalues,
    locationcov = Vector{Variable}(),
    logscalecov = Vector{Variable}(),
    shapecov = Vector{Variable}()
    )

Estimate the GEV parameters.

Arguments

  • y::Vector{<:Real}: the vector of block maxima.
  • initialvalues::Vector{<:Real}: Vector of parameters initial values.
  • locationcov::Vector{<:DataItem} = Vector{Variable}(): The covariates of the location parameter.
  • logscalecov::Vector{<:DataItem} = Vector{Variable}(): The covariates of the log-scale parameter.
  • shapecov::Vector{<:DataItem} = Vector{Variable}(): The covariates of the shape parameter.
source
Extremes.gevfitMethod
gevfit(y,
    locationcov = Vector{Variable}(),
    logscalecov = Vector{Variable}(),
    shapecov = Vector{Variable}()
    )

Estimate the GEV parameters.

Arguments

  • y::Vector{<:Real}: The vector of block maxima.
  • locationcov::Vector{<:DataItem} = Vector{Variable}(): The covariates of the location parameter.
  • logscalecov::Vector{<:DataItem} = Vector{Variable}(): The covariates of the log-scale parameter.
  • shapecov::Vector{<:DataItem} = Vector{Variable}(): The covariates of the shape parameter.
source
Extremes.gumbelfitFunction
gumbelfit()

Estimate the Gumbel parameters by maximum likelihood.

Details

The Gumbel distribution is a particular case of the generalized extreme value distribution when the shape parameter is zero.

Extreme value theory

In extreme value theory, it is best to avoid the choice of a sub-family of extreme value familu as the Gumbel. This is because the choice of family is made with the data at hand, and when extrapolating to large quantiles, i.e. larger than the range of the data, the uncertainty associated with this choice is not taken into account. If the data suggest that the Gumbel family is the best one, this does not imply that the other families are not plausible. In applications, the confidence intervals on the shape parameter are often wide, representing the difficulty of discriminating the tail behavior using only the limited number of data. Therefore, the use of the GEV distribution for the block maxima model makes more sense. As Coles (2001) also argued in Page 64, this is "...the safest option is to accept there is uncertainty about the value of the shape parameter ... and to prefer the inference based on the GEV model. The larger measures of uncertainty generated by the GEV model then provide a more realistic quantification of the genuine uncertainties involved in model extrapolation."

Implementation

The function uses Nelder-Mead solver implemented in the Optim.jl package to find the point where the log-likelihood is maximal.

The Gumbel parameters can be modeled as function of covariates as follows:

\[μ = X₁ × β₁,\]

\[ϕ = X₂ × β₂,\]

The covariates are standardized before estimating the parameters to help fit the model. They are transformed back on their original scales before returning the fitted model.

See also gumbelfit for the other methods and gevfit for estiming the parameters of the GEV distribution.

source
Extremes.gumbelfitMethod
gumbelfit(model::{BlockMaxima{Gumbel}}, initialvalues::Vector{<:Real})

Estimate the parameters of the BlockMaxima model using the given initialvalues.

source
Extremes.gumbelfitMethod
gumbelfit(df::DataFrame,
    datacol::Symbol,
    locationcovid = Vector{Symbol}(),
    logscalecovid = Vector{Symbol}()
    )

Estimate the Gumbel parameters.

Arguments

  • df::DataFrame: The dataframe containing the data.
  • datacol::Symbol: The symbol of the column of df containing the block maxima data.
  • initialvalues::Vector{<:Real}: Vector of parameters initial values.
  • locationcovid::Vector{Symbol} = Vector{Symbol}(): The symbols of the columns of df containing the covariates of the location parameter.
  • logscalecovid::Vector{Symbol} = Vector{Symbol}(): The symbols of the columns of df containing the covariates of the log-scale parameter.
source
Extremes.gumbelfitMethod
gumbelfit(df::DataFrame,
    datacol::Symbol,
    locationcovid = Vector{Symbol}(),
    logscalecovid = Vector{Symbol}(),
    shapecovid = Vector{Symbol}()
    )

Estimate the Gumbel parameters.

Arguments

  • df::DataFrame: The dataframe containing the data.
  • datacol::Symbol: The symbol of the column of df containing the block maxima data.
  • locationcovid::Vector{Symbol} = Vector{Symbol}(): The symbols of the columns of df containing the covariates of the location parameter.
  • logscalecovid::Vector{Symbol} = Vector{Symbol}(): The symbols of the columns of df containing the covariates of the log-scale parameter.
source
Extremes.gumbelfitMethod
gumbelfit(y,
    initialvalues,
    locationcov = Vector{Variable}(),
    logscalecov = Vector{Variable}()
    )

Estimate the Gumbel parameters.

Arguments

  • y::Vector{<:Real}: the vector of block maxima.
  • initialvalues::Vector{<:Real}: Vector of parameters initial values.
  • locationcov::Vector{<:DataItem} = Vector{Variable}(): The covariates of the location parameter.
  • logscalecov::Vector{<:DataItem} = Vector{Variable}(): The covariates of the log-scale parameter.
source
Extremes.gumbelfitMethod
gumbelfit(y,
    locationcov = Vector{Variable}(),
    logscalecov = Vector{Variable}()
    )

Estimate the Gumbel parameters.

Arguments

  • y::Vector{<:Real}: The vector of block maxima.
  • locationcov::Vector{<:DataItem} = Vector{Variable}(): The covariates of the location parameter.
  • logscalecov::Vector{<:DataItem} = Vector{Variable}(): The covariates of the log-scale parameter.
source
Extremes.gpfitFunction
gpfit(...)

Estimate the GP parameters by maximum likelihood.

Data provided must be the exceedances above the threshold, i.e. the data above the threshold minus the threshold.

Implementation

The function uses Nelder-Mead solver implemented in the Optim.jl package to find the point where the log-likelihood is maximal.

The GP parameters can be modeled as function of covariates as follows:

\[ϕ = X₂ × β₂,\]

\[ξ = X₃ × β₃.\]

The covariates are standardized before estimating the parameters to help fit the model. They are transformed back on their original scales before returning the fitted model.

See also gpfit for the other methods, gpfitpwm, gpfitbayes and ThresholdExceedance.

source
Extremes.gpfitMethod
gpfit(df::DataFrame,
    datacol::Symbol,
    logscalecovid = Vector{Symbol}(),
    shapecovid = Vector{Symbol}()
    )

Estimate the GP parameters

Arguments

  • df::DataFrame: The dataframe containing the data.
  • datacol::Symbol: The symbol of the column of df containing the exceedances.
  • initialvalues::Vector{<:Real}: Vector of parameters initial values.
  • logscalecovid::Vector{Symbol} = Vector{Symbol}(): The symbols of the columns of df containing the covariates of the log-scale parameter.
  • shapecovid::Vector{Symbol} = Vector{Symbol}(): The symbols of the columns of df containing the covariates of the shape parameter.
source
Extremes.gpfitMethod
gpfit(df::DataFrame,
    datacol::Symbol,
    logscalecovid = Vector{Symbol}(),
    shapecovid = Vector{Symbol}()
    )

Estimate the GP parameters

Arguments

  • df::DataFrame: The dataframe containing the data.
  • datacol::Symbol: The symbol of the column of df containing the exceedances.
  • logscalecovid::Vector{Symbol} = Vector{Symbol}(): The symbols of the columns of df containing the covariates of the log-scale parameter.
  • shapecovid::Vector{Symbol} = Vector{Symbol}(): The symbols of the columns of df containing the covariates of the shape parameter.
source
Extremes.gpfitMethod
gpfit(model::ThresholdExceedance, initialvalues::Vector{<:Real})

Estimate the parameters of the ThresholdExceedance model using the given initialvalues.

source
Extremes.gpfitMethod
gpfit(y,
    initialvalues;
    logscalecov = Vector{Variable}(),
    shapecov = Vector{Variable}()
    )

Estimate the GP parameters

Arguments

  • y::Vector{<:Real}: The vector of exceedances.
  • initialvalues::Vector{<:Real}: The vector of parameters initial values.
  • logscalecov::Vector{<:DataItem} = Vector{Variable}(): The covariates of the log-scale parameter.
  • shapecov::Vector{<:DataItem} = Vector{Variable}(): The covariates of the shape parameter.
source
Extremes.gpfitMethod
gpfit(y,
    logscalecov = Vector{Variable}(),
    shapecov = Vector{Variable}()
    )

Estimate the GP parameters

Arguments

  • y::Vector{<:Real}: The vector of exceedances.
  • logscalecov::Vector{<:DataItem} = Vector{Variable}(): The covariates of the log-scale parameter.
  • shapecov::Vector{<:DataItem} = Vector{Variable}(): The covariates of the shape parameter.
source
Extremes.gevfitpwmFunction
gevfitpwm(...)

Estimate the GEV parameters with the probability weighted moments.

Implementation

Estimation with the probability weighted moments, as described by Hosking et al. (1985), is only possible in the stationary case.

See also gevfitpwm for the other methods, gevfit, gevfitbayes and BlockMaxima.

Reference

Hosking, J. R. M., Wallis, J. R. and Wood, E. F. (1985). Estimation of the generalized extreme-value distribution by the method of probability-weighted moments. Technometrics, 27:251-261.

source
Extremes.gevfitpwmMethod
gevfitpwm(model::BlockMaxima{GeneralizedExtremeValue})

Estimate the GEV parameters with the probability weighted moments.

source
Extremes.gevfitpwmMethod
gevfitpwm(df::DataFrame, datacol::Symbol)

Estimate the GEV parameters with the probability weighted moments.

Block maxima data are in the column datacol of the dataframe df.

source
Extremes.gevfitpwmMethod
gevfitpwm(y::Vector{<:Real})

Estimate the GEV parameters with the probability weighted moments.

source
Extremes.gumbelfitpwmFunction
gumbelfitpwm(...)

Estimate the Gumbel parameters with the probability weighted moments.

Implementation

Estimation with the probability weighted moments, as described by Landwehr *et al. (1979), is only possible in the stationary case.

See also gumbelfitpwm for the other methods, gevfit, gevfitbayes and BlockMaxima.

Reference

Landwehr, J. M., Matalas, N. C. and Wallis, J. R. (1979). Probability weighted moments compared with some traditional techniques in estimating Gumbel parameters and quantiles. Water Resources Research, 15:1055–1064.

source
Extremes.gumbelfitpwmMethod
gumbelfitpwm(model::BlockMaxima{Gumbel})

Estimate the Gumbel parameters with the probability weighted moments.

source
Extremes.gumbelfitpwmMethod
gumbelfitpwm(df::DataFrame, datacol::Symbol)::pwmAbstractExtremeValueModel

Estimate the Gumbel parameters with the probability weighted moments.

Block maxima data are in the column datacol of the dataframe df.

source
Extremes.gumbelfitpwmMethod
gumbelfitpwm(y::Vector{<:Real})

Estimate the Gumbel parameters with the probability weighted moments.

source
Extremes.gpfitpwmFunction
gpfitpwm(...)

Estimate the GP parameters with the probability weighted moments.

Implementation

Estimation with the probability weighted moments, as described by Hosking and Wallis (1987), is only possible in the stationary case.

See also gpfitpwm for the other methods, gpfit, gpfitbayes and ThresholdExceedance.

Reference

Hosking, J. R. M. and Wallis, J. R. (1987). Parameter and quantile estimation for the Generalized Pareto distribution, Technometrics, 29:339-349.

source
Extremes.gpfitpwmMethod
gpfitpwm(df::DataFrame, datacol::Symbol)

Estimate the GP parameters with the probability weighted moments.

Block maxima data are in the column datacol of the dataframe df.

source
Extremes.gpfitpwmMethod
gpfitpwm(model::ThresholdExceedance)

Estimate the GP parameters with the probability weighted moments.

source
Extremes.gpfitpwmMethod
gpfitpwm(y::Vector{<:Real})

Estimate the GP parameters with the probability weighted moments.

source
Extremes.gevfitbayesFunction
gevfitbayes(..., niter::Int=5000, warmup::Int=2000)

Generate a sample from the GEV parameters' posterior distribution.

Arguments

  • niter::Int = 5000: The total number of MCMC iterations.
  • warmup::Int = 2000: The number of warmup iterations (burn-in).

Implementation

The function uses the No-U-Turn Sampler (NUTS; Hoffman and Gelman, 2014) implemented in the Mamba.jl package to generate a random sample from the posterior distribution.

Currently, only the improper uniform prior is implemented, i.e.

\[f_{(β₁,β₂,β₃)}(β₁,β₂,β₃) ∝ 1,\]

where

\[μ = X₁ × β₁,\]

\[ϕ = X₂ × β₂,\]

\[ξ = X₃ × β₃.\]

In the stationary case, this improper prior yields to a proper posterior if the sample size is larger than 3 (Northrop and Attalides, 2016).

The covariates are standardized before estimating the parameters to help fit the model. They are transformed back on their original scales before returning the fitted model.

See also gevfitbayes for the other methods, gevfitpwm, gevfit and BlockMaxima.

References

Hoffman M. D. and Gelman A. (2014). The No-U-Turn sampler: adaptively setting path lengths in Hamiltonian Monte Carlo. Journal of Machine Learning Research, 15:1593–1623.

Paul J. Northrop P. J. and Attalides N. (2016). Posterior propriety in Bayesian extreme value analyses using reference priors. Statistica Sinica, 26:721-743.

source
Extremes.gevfitbayesMethod
gevfitbayes(model::BlockMaxima{GeneralizedExtremeValue};
    niter::Int=5000,
    warmup::Int=2000)

Generate a sample from the BlockMaxima model parameters' posterior distribution.

source
Extremes.gevfitbayesMethod
gevfitbayes(df::DataFrame,
    datacol::Symbol,
    locationcovid = Vector{Symbol}(),
    logscalecovid = Vector{Symbol}(),
    shapecovid = Vector{Symbol}(),
    niter::Int=5000,
    warmup::Int=2000)

Generate a sample from the GEV parameters' posterior distribution.

Arguments

  • df::DataFrame: The dataframe containing the data.
  • datacol::Symbol: The symbol of the column of df containing the block maxima data.
  • locationcovid::Vector{Symbol} = Vector{Symbol}(): The symbols of the columns of df containing the covariates of the location parameter.
  • logscalecovid::Vector{Symbol} = Vector{Symbol}(): The symbols of the columns of df containing the covariates of the log-scale parameter.
  • shapecovid::Vector{Symbol} = Vector{Symbol}(): The symbols of the columns of df containing the covariates of the shape parameter.
source
Extremes.gevfitbayesMethod
gevfitbayes(y,
    locationcov = Vector{Variable}(),
    logscalecov = Vector{Variable}(),
    shapecov = Vector{Variable}(),
    niter::Int=5000,
    warmup::Int=2000
    )

Generate a sample from the GEV parameters' posterior distribution.

Arguments

  • y::Vector{<:Real}: The vector of block maxima.
  • locationcov::Vector{<:DataItem} = Vector{Variable}(): The covariates of the location parameter.
  • logscalecov::Vector{<:DataItem} = Vector{Variable}(): The covariates of the log-scale parameter.
  • shapecov::Vector{<:DataItem} = Vector{Variable}(): The covariates of the shape parameter.
source
Extremes.gumbelfitbayesFunction
gumbelfitbayes(..., niter::Int=5000, warmup::Int=2000)

Generate a sample from the Gumbel parameters' posterior distribution.

Arguments

  • niter::Int = 5000: The total number of MCMC iterations.
  • warmup::Int = 2000: The number of warmup iterations (burn-in).

Implementation

The function uses the No-U-Turn Sampler (NUTS; Hoffman and Gelman, 2014) implemented in the Mamba.jl package to generate a random sample from the posterior distribution.

Currently, only the improper uniform prior is implemented, i.e.

\[f_{(β₁,β₂,β₃)}(β₁,β₂,β₃) ∝ 1,\]

where

\[μ = X₁ × β₁,\]

\[ϕ = X₂ × β₂,\]

In the stationary case, this improper prior yields to a proper posterior if the sample size is larger than 3 (Northrop and Attalides, 2016).

The covariates are standardized before estimating the parameters to help fit the model. They are transformed back on their original scales before returning the fitted model.

See also gevfitbayes for the other methods and BlockMaxima.

References

Hoffman M. D. and Gelman A. (2014). The No-U-Turn sampler: adaptively setting path lengths in Hamiltonian Monte Carlo. Journal of Machine Learning Research, 15:1593–1623.

Paul J. Northrop P. J. and Attalides N. (2016). Posterior propriety in Bayesian extreme value analyses using reference priors. Statistica Sinica, 26:721-743.

source
Extremes.gumbelfitbayesMethod
gumbelfitbayes(model::BlockMaxima{Gumbel};
    niter::Int=5000,
    warmup::Int=2000)

Generate a sample from the BlockMaxima model parameters' posterior distribution.

source
Extremes.gumbelfitbayesMethod
gumbelfitbayes(df::DataFrame,
    datacol::Symbol,
    locationcovid = Vector{Symbol}(),
    logscalecovid = Vector{Symbol}(),
    niter::Int=5000,
    warmup::Int=2000)

Generate a sample from the Gumbel parameters' posterior distribution.

Arguments

  • df::DataFrame: The dataframe containing the data.
  • datacol::Symbol: The symbol of the column of df containing the block maxima data.
  • locationcovid::Vector{Symbol} = Vector{Symbol}(): The symbols of the columns of df containing the covariates of the location parameter.
  • logscalecovid::Vector{Symbol} = Vector{Symbol}(): The symbols of the columns of df containing the covariates of the log-scale parameter.
source
Extremes.gumbelfitbayesMethod
gumbelfitbayes(y,
    locationcov = Vector{Variable}(),
    logscalecov = Vector{Variable}(),
    niter::Int=5000,
    warmup::Int=2000
    )

Generate a sample from the Gumbel parameters' posterior distribution.

Arguments

  • y::Vector{<:Real}: The vector of block maxima.
  • locationcov::Vector{<:DataItem} = Vector{Variable}(): The covariates of the location parameter.
  • logscalecov::Vector{<:DataItem} = Vector{Variable}(): The covariates of the log-scale parameter.
source
Extremes.gpfitbayesFunction
gpfitbayes(..., niter::Int=5000, warmup::Int=2000)

Generate a sample from the GP parameters' posterior distribution.

Data provided must be the exceedances above the threshold, i.e. the data above the threshold minus the threshold.

Arguments

  • niter::Int = 5000: The total number of MCMC iterations
  • warmup::Int = 2000: The number of warmup iterations (burn-in).

Implementation

The function uses the No-U-Turn Sampler (NUTS; Hoffman and Gelman, 2014) implemented in the Mamba.jl package to generate a random sample from the posterior distribution.

Currently, only the improper uniform prior is implemented, i.e.

\[f_{(β₂,β₃)}(β₂,β₃) ∝ 1,\]

where

\[ϕ = X₂ × β₂,\]

\[ξ = X₃ × β₃.\]

In the stationary case, this improper prior yields to a proper posterior if the sample size is larger than 2 (Northrop and Attalides, 2016).

The covariates are standardized before estimating the parameters to help fit the model. They are transformed back on their original scales before returning the fitted model.

See also gpfitbayes for the other methods, gpfitpwm, gpfit and ThresholdExceedance.

Reference

Hoffman M. D. and Gelman A. (2014). The No-U-Turn sampler: adaptively setting path lengths in Hamiltonian Monte Carlo. Journal of Machine Learning Research, 15:1593–1623.

Paul J. Northrop P. J. and Attalides N. (2016). Posterior propriety in Bayesian extreme value analyses using reference priors. Statistica Sinica, 26:721-743.

source
Extremes.gpfitbayesMethod
gpfitbayes(df::DataFrame,
    datacol::Symbol,
    logscalecovid = Vector{Symbol}(),
    shapecovid = Vector{Symbol}(),
    niter::Int=5000,
    warmup::Int=2000)

Generate a sample from the GP parameters' posterior distribution.

Arguments

  • df::DataFrame: The dataframe containing the data.
  • datacol::Symbol: The symbol of the column of df containing the exceedances.
  • logscalecovid::Vector{Symbol} = Vector{Symbol}(): The symbols of the columns of df containing the covariates of the log-scale parameter.
  • shapecovid::Vector{Symbol} = Vector{Symbol}(): The symbols of the columns of df containing the covariates of the shape parameter.
source
Extremes.gpfitbayesMethod
gpfitbayes(model::ThresholdExceedance;
    niter::Int=5000,
    warmup::Int=2000)

Generate a sample from the GP parameters' posterior distribution.

source
Extremes.gpfitbayesMethod
gpfitbayes(y,
    logscalecov = Vector{Variable}(),
    shapecov = Vector{Variable}(),
    niter::Int=5000,
    warmup::Int=2000
    )

Generate a sample from the GP parameters' posterior distribution.

Arguments

  • y::Vector{<:Real}: The vector of exceedances.
  • logscalecov::Vector{<:DataItem} = Vector{Variable}(): The covariates of the log-scale parameter.
  • shapecov::Vector{<:DataItem} = Vector{Variable}(): The covariates of the shape parameter.
source

Methods on fitted models

Extremes.getclusterMethod
getcluster(y::Vector{<:Real}, u₁::Real, u₂::Real)

Extract the clusters from vector y.

A cluster is defined as a sequence of values higher than threshold u₂ with at least a value higher than threshold u₁.

See also Cluster.

source
Extremes.getclusterMethod
getcluster(y::Vector{<:Real}, u::Real; runlength::Int=1)::Vector{Cluster}

Extract the clusters from vector y.

Threshold exceedances separated by fewer than r non-exceedances belong to the same cluster. The value r is corresponds to the runlength parameter. This approach is referred to as the runs declustering scheme (see Coles, 2001 sec. 5.3.2).

See also Cluster.

source
Distributions.scaleMethod
scale(fm::AbstractFittedExtremeValueModel)

Return the scale parameters of the fitted model.

source
Distributions.shapeMethod
shape(fm::AbstractFittedExtremeValueModel)

Return the shape parameters of the fitted model.

source
Extremes.cintFunction
cint(..., confidencelevel::Real=.95)

Compute confidence interval or credible interval in the case of Bayesian estimation.

The function can be applied on any AbstractFittedExtremeValueModel subtype to obtain a confidence interval on the model parameters. It can also be applied on ReturnLevel type to obtain a confidence interval on the return level.

Implementation

The method used for computing the interval depends on the estimation method. In the case of maximum likelihood estimation, the confidence intervals are computed using the Wald approximation based on the approximate parameter estimates covariance matrix. In the case of Bayesian estimation, the return interval is the highest posterior density estimate based on the MCMC sample. In the case of probability weighted moment estimation, the intervals are computed using a boostrap procedure.

source
StatsAPI.paramsMethod
params(fm::AbstractFittedExtremeValueModel)

Return the parameters of the fitted model.

source
Extremes.parametervarMethod
parametervar(fm::BayesianAbstractExtremeValueModel)::Array{Float64, 2}

Compute the covariance parameters estimate of the fitted model fm.

source
Extremes.returnlevelMethod
returnlevel(fm::BayesianAbstractExtremeValueModel{ThresholdExceedance}, threshold::Real, nobservation::Int,
    nobsperblock::Int, returnPeriod::Real)::ReturnLevel

Compute the return level corresponding to the return period returnPeriod from the fitted model fm.

The threshold should be a scalar. A varying threshold is not yet implemented.

source
Extremes.returnlevelMethod
returnlevel(fm::BayesianAbstractExtremeValueModel{BlockMaxima}, returnPeriod::Real)::ReturnLevel

Compute the return level corresponding to the return period returnPeriod from the fitted model fm.

source
Extremes.aicMethod
aic(fm:::MaximumLikelihoodAbstractExtremeValueModel)

Compute the Akaike information criterion (AIC) of the fitted model by maximum likelihood method.

Details

The AIC is defined as follows:

$AIC = 2 k - 2 \log \hat{L};$

where $k$ is the number of estimated parameters and $\hat{L}$ is the maximized value of the likelihood function for the model.

source
Extremes.bicMethod
bic(fm:::MaximumLikelihoodAbstractExtremeValueModel)

Compute the Bayesian information criterion (BIC) of the fitted model by maximum likelihood method.

Details

The BIC is defined as follows:

$BIC = k \log n - 2 \log \hat{L};$

where $k$ is the number of estimated parameters, $n$ is the number of data and $\hat{L}$ is the maximized value of the likelihood function for the model.

source
Extremes.parametervarMethod
parametervar(fm::MaximumLikelihoodAbstractExtremeValueModel)::Array{Float64, 2}

Compute the covariance parameters estimate of the fitted model fm.

source
Extremes.returnlevelMethod
returnlevel(fm::MaximumLikelihoodAbstractExtremeValueModel{ThresholdExceedance}, threshold::Real, nobservation::Int,
    nobsperblock::Int, returnPeriod::Real)::ReturnLevel

Compute the return level corresponding to the return period returnPeriod from the fitted model fm.

The threshold should be a scalar. A varying threshold is not yet implemented.

source
Extremes.returnlevelMethod
returnlevel(fm::MaximumLikelihoodAbstractExtremeValueModel{BlockMaxima}, returnPeriod::Real)::ReturnLevel

Compute the return level corresponding to the return period returnPeriod from the fitted model fm.

source
Extremes.parametervarFunction
parametervar(fm::pwmAbstractExtremeValueModel, nboot::Int=1000)

Estimate the parameter estimates covariance matrix by bootstrap.

source
Extremes.returnlevelMethod
returnlevel(fm::pwmAbstractExtremeValueModel{ThresholdExceedance, T} where T<:Distribution, threshold::Real, nobservation::Int,
    nobsperblock::Int, returnPeriod::Real)::ReturnLevel

Compute the return level corresponding to the return period returnPeriod from the fitted model fm.

The threshold should be a scalar. A varying threshold is not yet implemented.

source
Extremes.returnlevelMethod
returnlevel(fm::pwmAbstractExtremeValueModel{BlockMaxima, T} where T<:Distribution, returnPeriod::Real)::ReturnLevel

Compute the confidence intervel for the return level corresponding to the return period returnPeriod from the fitted model fm with confidence level confidencelevel.

source

Diagnostic plots

Extremes.qqplotciFunction
qqplotci(fm::AbstractFittedExtremeValueModel, α::Real=.05)

Quantile-Quantile plot along with the confidence/credible interval of level 1-α.

Note

This function is currently only available for stationary models.

See also returnlevelplotci and qqplot.

Example

using Distributions, Extremes

pd = GeneralizedExtremeValue(0,1,0)
y = rand(pd, 300)
fm = gevfit(y)

qqplotci(fm)
source
Extremes.returnlevelplotciFunction
returnlevelplotci(fm::AbstractFittedExtremeValueModel, α::Real=.05)

Return level plot along with the confidence/credible interval of level 1-α.

Note

This function is currently only available for stationary models.

See also returnlevelplotci and qqplot.

Example

using Distributions, Extremes

pd = GeneralizedExtremeValue(0,1,0)
y = rand(pd, 300)
fm = gevfit(y)

returnlevelplotci(fm)
source
Extremes.mrlplot_dataFunction
mrlplot_data(y::Vector{<:Real}, steps::Int = 100)::DataFrame

Compute the mean residual life from vector y.

The set of thresholds ranges from minimum(y) to the second-to-last larger value in steps number of steps.

source

Types

Extremes.AbstractFittedExtremeValueModelType
AbstractFittedExtremeValueModel{T<:AbstractExtremeValueModel}

Abstract type containing the fitted extreme value model types.

  • BayesianAbstractExtremeValueModel
  • MaximumLikelihoodAbstractExtremeValueModel
  • pwmAbstractExtremeValueModel
source
Extremes.BlockMaximaMethod
BlockMaxima{GeneralizedExtremeValue}(data::Vector{<:Real};
    locationcov::Vector{Variable} = Vector{Variable}(),
    logscalecov::Vector{Variable} = Vector{Variable}(),
    shapecov::Vector{Variable} = Vector{Variable}())::BlockMaxima

Creates a BlockMaxima structure.

source
Extremes.BlockMaximaMethod
BlockMaxima{Gumbel}(data::Vector{<:Real};
    locationcov::Vector{Variable} = Vector{Variable}(),
    logscalecov::Vector{Variable} = Vector{Variable}())::BlockMaxima

Creates a BlockMaxima{Gumbel} structure.

source
Extremes.ClusterType
Cluster(u₁::Real,u₂::Real,position::Vector{<:Int},value::Vector{<:Real})

Cluster type.

source
Extremes.FlatType
Flat()

Construct a Flat <: ContinuousUnivariateDistribution object representing an improper uniform distribution on the real line.

source
Extremes.ThresholdExceedanceMethod
ThresholdExceedance(exceedances::Vector{<:Real};
    logscalecov::Vector{<:DataItem} = Vector{Variable}(),
    shapecov::Vector{<:DataItem} = Vector{Variable}())::ThresholdExceedance

Creates a ThresholdExceedance structure.

source
Extremes.VariableStdMethod
VariableStd(name::String, z::Vector{<:Real})::VariableStd

Construct a VariableStd type from the standardized vector z with the name name.

source