GeneralizedExtremeValueFactory¶
(Source code
, png
)
- class GeneralizedExtremeValueFactory(*args)¶
GeneralizedExtremeValue factory.
See also
Methods
build
(*args)Estimate the distribution as a
Frechet
,Gumbel
orWeibullMax
distribution.Estimate the distribution as a
Frechet
,Gumbel
orWeibullMax
distribution.buildEstimator
(*args)Build the distribution and the parameter distribution.
Estimate the distribution from the largest order statistics.
Estimate the distribution and the parameter distribution with the R-maxima method.
Estimate the distribution with the profile likelihood.
Estimate the distribution and the parameter distribution with the profile likelihood.
buildReturnLevelEstimator
(result, m)Estimate a return level and its distribution from the GEV parameters.
buildReturnLevelProfileLikelihood
(sample, m)Estimate a return level and its distribution with the profile likelihood.
Estimate and its distribution with the profile likelihood.
buildTimeVarying
(*args)Estimate a non stationary GEV.
Accessor to the bootstrap size.
Accessor to the object's name.
getId
()Accessor to the object's id.
getName
()Accessor to the object's name.
Accessor to the object's shadowed id.
Accessor to the object's visibility state.
hasName
()Test if the object is named.
Test if the object has a distinguishable name.
setBootstrapSize
(bootstrapSize)Accessor to the bootstrap size.
setName
(name)Accessor to the object's name.
setShadowedId
(id)Accessor to the object's shadowed id.
setVisibility
(visible)Accessor to the object's visibility state.
- __init__(*args)¶
- build(*args)¶
Estimate the distribution as a
Frechet
,Gumbel
orWeibullMax
distribution.Available usages:
build(sample)
build(param)
- Parameters:
- sample2-d sequence of float
The block maxima sample of dimension 1.
- paramCollection of
PointWithDescription
A vector of parameters of the distribution.
- Returns:
- distribution
GeneralizedExtremeValue
The estimated distribution.
- distribution
Notes
The strategy consists in fitting the three models
Frechet
,Gumbel
andWeibullMax
on the data. Then, the three models are classified with respect to the BIC criterion. The best one is returned.
- buildAsGeneralizedExtremeValue(*args)¶
Estimate the distribution as a
Frechet
,Gumbel
orWeibullMax
distribution.Same as
build()
.
- buildEstimator(*args)¶
Build the distribution and the parameter distribution.
- Parameters:
- sample2-d sequence of float
Sample from which the distribution parameters are estimated.
- parameters
DistributionParameters
Optional, the parametrization.
- Returns:
- resDist
DistributionFactoryResult
The results.
- resDist
Notes
According to the way the native parameters of the distribution are estimated, the parameters distribution differs:
Moments method: the asymptotic parameters distribution is normal and estimated by Bootstrap on the initial data;
Maximum likelihood method with a regular model: the asymptotic parameters distribution is normal and its covariance matrix is the inverse Fisher information matrix;
Other methods: the asymptotic parameters distribution is estimated by Bootstrap on the initial data and kernel fitting (see
KernelSmoothing
).
If another set of parameters is specified, the native parameters distribution is first estimated and the new distribution is determined from it:
if the native parameters distribution is normal and the transformation regular at the estimated parameters values: the asymptotic parameters distribution is normal and its covariance matrix determined from the inverse Fisher information matrix of the native parameters and the transformation;
in the other cases, the asymptotic parameters distribution is estimated by Bootstrap on the initial data and kernel fitting.
- buildMethodOfLikelihoodMaximization(sample, r=0)¶
Estimate the distribution from the largest order statistics.
Let us suppose we have a series of independent and identically distributed variables and that data are grouped into blocks. In each block, the largest observations are recorded.
We define the series for where the values are sorted in decreasing order.
The estimator of maximizes the log-likelihood built from the largest order statisctics, with defined as:
If , then:
(1)¶
defined on such that for all and .
If , then:
(2)¶
- Parameters:
- sample2-d sequence of float
Block maxima grouped in a sample of size and dimension .
- rint, ,
Number of largest order statistics taken into account among the stored ones.
By default, which means that all the maxima are used.
- Returns:
- distribution
GeneralizedExtremeValue
The estimated distribution.
- distribution
- buildMethodOfLikelihoodMaximizationEstimator(sample, r=0)¶
Estimate the distribution and the parameter distribution with the R-maxima method.
The estimators are defined using the profile log-likelihood as detailed in
buildMethodOfLikelihoodMaximization()
.The result class produced by the method provides:
the GEV distribution associated to ,
the asymptotic distribution of .
- Parameters:
- sampleM2-d sequence of float
Block maxima grouped in a sample of size and dimension .
- rint, , optional
Number of order statistics taken into account among the stored ones.
By default, which means that all the maxima are used.
- Returns:
- result
DistributionFactoryLikelihoodResult
The result class.
- result
- buildMethodOfProfileLikelihoodMaximization(sample)¶
Estimate the distribution with the profile likelihood.
The estimator is defined using a nested numerical optimization of the log-likelihood:
where is detailed in equations (1) and (2) with .
The estimator is given by:
- Parameters:
- sample2-d sequence of float
The block maxima sample of dimension 1.
- Returns:
- distribution
GeneralizedExtremeValue
The estimated distribution.
- distribution
Notes
The starting point of the optimization is initialized from the probability weighted moments method, see [diebolt2008].
- buildMethodOfProfileLikelihoodMaximizationEstimator(sample)¶
Estimate the distribution and the parameter distribution with the profile likelihood.
The estimators are defined in
buildMethodOfProfileLikelihoodMaximization()
.The result class produced by the method provides:
the GEV distribution associated to ,
the asymptotic distribution of ,
the profile log-likelihood function ,
the optimal profile log-likelihood value ,
confidence intervals of level of .
- Parameters:
- sample2-d sequence of float
The block maxima sample of dimension 1.
- Returns:
- result
ProfileLikelihoodResult
The result class.
- result
- buildReturnLevelEstimator(result, m)¶
Estimate a return level and its distribution from the GEV parameters.
The -return level is the level exceeded on average once every blocks. The parameter is referred to as the return period. For example, if the GEV distribution is the distribution of the annual maxima, then is the 100-year return period and is exceeded on average once in every century.
The -return level is defined as the quantile of order of the GEV distribution.
If :
(3)¶
If :
(4)¶
The estimator of is deduced from the estimator of .
The asymptotic distribution of is obtained by the Delta method from the asymptotic distribution of . It is a normal distribution with mean and variance:
where and is the asymptotic covariance of .
- Parameters:
- result
DistributionFactoryResult
Likelihood estimation result of a
GeneralizedExtremeValue
- mfloat
The return period expressed in terms of number of blocks.
- result
- Returns:
- distribution
Distribution
The asymptotic distribution of .
- distribution
- buildReturnLevelProfileLikelihood(sample, m)¶
Estimate a return level and its distribution with the profile likelihood.
The estimator is defined using a nested numerical optimization of the log-likelihood:
where is the log-likelihood detailed in (1) and (2) with and where we substitued for using equations (3) or (4).
The estimator of is defined by:
The asymptotic distribution of is normal.
- Parameters:
- sample2-d sequence of float
The block maxima sample of dimension 1.
- Returns:
- distribution
Normal
The asymptotic distribution of .
- distribution
Notes
The starting point of the optimization is initialized from the regular maximum likelihood method.
- buildReturnLevelProfileLikelihoodEstimator(sample, m)¶
Estimate and its distribution with the profile likelihood.
The estimators are defined in
buildReturnLevelProfileLikelihood()
.The parameter estimates are given by:
The result class produced by the method provides:
the GEV distribution associated to ,
the asymptotic distribution of ,
the profile log-likelihood function ,
the optimal profile log-likelihood value ,
confidence intervals of level of .
- Parameters:
- sample2-d sequence of float
The block maxima sample of dimension 1.
- mfloat
The return period, defines the level of the quantile as .
- Returns:
- result
ProfileLikelihoodResult
The result class.
- result
- buildTimeVarying(*args)¶
Estimate a non stationary GEV.
We consider a non stationary GEV model to describe the distribution of :
We have the values of on the time stamps .
For numerical reasons, it is recommended to normalize the time stamps. OpenTURNS applies the following mapping:
and with three ways of defining :
the CenterReduce method where is the mean time stamps and is the standard deviation of the time stamps;
the MinMax method where is the first time and the range of the time stamps;
the None method where and : in that case, data are not normalized.
Each of has an expression in terms of a parameter vector and time functions:
where:
is usually referred to as the inverse-link function. The function denotes either , or ,
each is a scalar function ,
each .
We denote by , and the size of the functional basis of ,