CovariatesResult¶
- class CovariatesResult(*args)¶
Estimation result class for a GEV or GPD model depending on covariates.
- Parameters:
- factory
DistributionFactory
Parent distribution factory.
- parameterFunction
Function
The function .
- covariates2-d sequence of float
Values of .
- parameterDistribution
Distribution
The distribution of .
- llhfloat
Maximum log-likelihood.
- factory
See also
Notes
This class is created by the method
buildCovariates()
of the classesGeneralizedExtremeValueFactory
andGeneralizedParetoFactory
.Let be a random variable which follows a GEV distribution or whose excesses above follow a GPD. We assume that the parameters of the GEV model or the GPD (except for the threshold of the GPD which is assumed to be known) depend on covariates denoted by :
We denote by the values of associated to the values of the covariates .
For numerical reasons, the covariates have been normalized. Each covariate has its own normalization:
Let be the set of parameters for the GEV model and for the GPD model. Then, depends on all the covariates even if each component of only depends on a subset of the covariates. We denote by the covariates involved in the modelling of the component .
Each component can be written as a function of the covariates:
where:
is usually referred to as the inverse-link function of the component ,
each .
To allow one of the parameters to remain constant, i.e. independent of the covariates (this will generally be the case for the parameter , the library systematically adds the constant covariate to the list specified by the user, even if it means duplicating it if the user has already put it in his list.
The complete vector of parameters is defined by:
where .
The estimator of maximizes the likelihood of the Parent distribution.
Methods
drawParameterFunction1D
(*args)Draw the parameter function.
drawParameterFunction2D
(*args)Draw the parameter function.
drawQuantileFunction1D
(*args)Draw the quantile function.
drawQuantileFunction2D
(*args)Draw the quantile function.
Accessor to the object's name.
Covariates accessor.
getDistribution
(covariates)Accessor to the Parent distribution at a given covariate vector.
Optimal likelihood value accessor.
getName
()Accessor to the object's name.
Normalizing function accessor.
Optimal parameter accessor.
Accessor to the distribution of .
Parameter function accessor.
hasName
()Test if the object is named.
setLogLikelihood
(logLikelihood)Optimal likelihood value accessor.
setName
(name)Accessor to the object's name.
setParameterDistribution
(parameterDistribution)Accessor to the distribution of of .
- __init__(*args)¶
- drawParameterFunction1D(*args)¶
Draw the parameter function.
- Parameters:
- parameterIndexint in [0, 2]
The index specifying the component .
- referencePointsequence of float, optional
Reference values for the frozen covariates. If not provided the mean of covariates is used.
- Returns:
- grid
GridLayout
Graphs of for .
- grid
Notes
Once the index has been chosen, the method draws all the graphs , where all the components of are fixed to a reference value excepted for , for each .
Each component of potentially depends only on a subset of the covariates. Hence, when the component does not depend on , the graph is reduced to one horizontal line.
- drawParameterFunction2D(*args)¶
Draw the parameter function.
- Parameters:
- parameterIndexint in [0, 2]
The index specifying the component .
- referencePointsequence of float, optional
Reference values for the frozen covariates. If not provided the mean of covariates is used.
- Returns:
- grid
GridLayout
Graphs of for .
- grid
Notes
Once the index has been chosen, the method draws all the graphs , where all the components of are fixed to a reference value excepted for , for each .
Each component of potentially depends only on a subset of the covariates. Hence, when the component does not depend on , the graph is reduced to one point. If it does not depend on one of the two, the graph is reduced to one line.
- drawQuantileFunction1D(*args)¶
Draw the quantile function.
- Parameters:
- pfloat
The quantile level.
- referencePointsequence of float, optional
Reference values for the frozen covariates. If not provided the mean of covariates is used.
- Returns:
- grid
GridLayout
Graphs of for .
- grid
Notes
The method plots all the graphs of the quantile functions of order : of : where all the components of are fixed to a reference value excepted for , for each .
Each component of potentially depends only on a subset of the covariates. Hence, when the component does not depend on , the graph is reduced to one horizontal line.
- drawQuantileFunction2D(*args)¶
Draw the quantile function.
- Parameters:
- pfloat
The quantile level.
- referencePointsequence of float, optional
Reference values for the frozen covariates. If not provided the mean of covariates is used.
- Returns:
- grid
GridLayout
Graphs of for .
- grid
Notes
The method plots all the graphs of the quantile functions of order : of : where all the components of are fixed to a reference value excepted for , for each .
Each component of potentially depends only on a subset of the covariates. Hence, when the component does not depend on , the graph is reduced to one point. If it does not depend on one of the two, the graph is reduced to one line.
- getClassName()¶
Accessor to the object’s name.
- Returns:
- class_namestr
The object class name (object.__class__.__name__).
- getCovariates()¶
Covariates accessor.
- Returns:
- covariates
Sample
The sample of covariates.
- covariates
Notes
If the constant covariate was not specified, a last column has been automatically added which contains the value 1.
- getDistribution(covariates)¶
Accessor to the Parent distribution at a given covariate vector.
- Parameters:
- covariatesequence of float, 2-d sequence of float
Covariates value .
- Returns:
- distribution
Distribution
The Parent distribution at covariate.
- distribution
- getLogLikelihood()¶
Optimal likelihood value accessor.
- Returns:
- llhfloat
Maximum log-likelihood.
- getName()¶
Accessor to the object’s name.
- Returns:
- namestr
The name of the object.
- getNormalizationFunction()¶
Normalizing function accessor.
- Returns:
- normalizeFunction
Function
The function .
- normalizeFunction
- getOptimalParameter()¶
Optimal parameter accessor.
- Returns:
- optimalParameter
Point
Optimal vector of parameters .
- optimalParameter
- getParameterDistribution()¶
Accessor to the distribution of .
- Returns:
- parameterDistribution
Distribution
The distribution of the estimator of .
- parameterDistribution
- getParameterFunction()¶
Parameter function accessor.
- Returns:
- parameterFunction
Function
The function .
- parameterFunction
- hasName()¶
Test if the object is named.
- Returns:
- hasNamebool
True if the name is not empty.
- setLogLikelihood(logLikelihood)¶
Optimal likelihood value accessor.
- Parameters:
- llhfloat
Maximum log-likelihood.
- setName(name)¶
Accessor to the object’s name.
- Parameters:
- namestr
The name of the object.
- setParameterDistribution(parameterDistribution)¶
Accessor to the distribution of of .
- Parameters:
- parameterDistribution
Distribution
The distribution of the estimator of .
- parameterDistribution
Examples using the class¶
Estimate a GEV on the Fremantle sea-levels data