TimeVaryingResult

class TimeVaryingResult(*args)

Estimation result class for a non stationary GEV or GPD model.

Parameters:
factoryDistributionFactory

Parent distribution factory.

data2-d sequence of float

Sample drawn from Z_t.

parameterFunctionFunction

The function t \mapsto \vect{\theta}(t).

timeStamps2-d sequence of float

Values of t.

parameterDistributionDistribution

The distribution of \vect{\beta}.

normalizationFunctionLinearFunction

The normalization function t \mapsto \tau(t).

llhfloat

Maximum log-likelihood.

Notes

This class is created by the method buildTimeVarying() of the classes GeneralizedExtremeValueFactory and GeneralizedParetoFactory.

Let Z_t be a non stationary random variable which follows a GEV distribution or whose excesses above u follow a GPD. The parameters of the GEV or GPD model depend on t:

Z_t & \sim \mbox{GEV}(\mu(t), \sigma(t), \xi(t))\\
Z_t & \sim \mbox{GPD}(\sigma(t), \xi(t), u)

For the GPD, the threshold u is assumed to be known.

We denote by (z_{t_1}, \dots, z_{t_n}) the values of Z_t on the time stamps (t_1, \dots, t_n).

For numerical reasons, the time stamps have been normalized using the linear function:

\tau(t) = \dfrac{t-c}{d}

Let \vect{\theta} = (\theta_1, \dots, \theta_p) be the set of parameters (\mu, \sigma, \xi) for the GEV model and (\sigma, \xi) for the GPD. Each component \theta_q can be written as a function of t:

\theta_q(t)  = h_q\left(\sum_{i=1}^{d_{\theta_q}} \beta_i^{\theta_q} \varphi_i^{\theta_q}(\tau(t))\right)

where:

  • d_{\theta_q} is the size of the functional basis involved in the modelling of \theta_q,

  • h_q: \Rset \mapsto \Rset is usually referred to as the inverse-link function of the component \theta_q,

  • each \varphi_i^{\theta_q} is a scalar function \Rset \mapsto \Rset,

  • each \beta_i^{j} \in \Rset.

We denote by \vect{\beta} = (\beta_1^{\theta_1}, \dots, \beta_{d_{\theta_1}}^{\theta_1}, \dots, \beta_1^{\theta_p}, \dots, \beta_{d_{\theta_p}}^{\theta_p}) the complete vector of parameters.

The estimator of the vector \vect{\beta} maximizes the likelihood of the Parent distribution (ie the distribution of Z_t).

Methods

drawDiagnosticPlot()

Draw the 4 usual diagnostic plots.

drawParameterFunction([parameterIndex])

Draw the parameter function.

drawQuantileFunction(p)

Draw the quantile function.

getClassName()

Accessor to the object's name.

getDistribution(t)

Accessor to the Parent distribution at a given time.

getLogLikelihood()

Optimal log-likelihood value accessor.

getName()

Accessor to the object's name.

getNormalizationFunction()

Normalizing function accessor.

getOptimalParameter()

Optimal parameter accessor.

getParameterDistribution()

Accessor to the distribution of \vect{\beta}.

getParameterFunction()

Parameter function accessor.

getTimeGrid()

Accessor to the time grid.

hasName()

Test if the object is named.

setLogLikelihood(logLikelihood)

Optimal log-likelihood value accessor.

setName(name)

Accessor to the object's name.

setParameterDistribution(parameterDistribution)

Accessor to the distribution of of \vect{\beta}.

__init__(*args)
drawDiagnosticPlot()

Draw the 4 usual diagnostic plots.

Returns:
gridGridLayout
Returns a grid of 4 graphs:
  • the QQ-plot,

  • the PP-plot,

  • the return level graph (with confidence lines),

  • the density graph.

Notes

Let Z_t be a non stationary random variable which follows a GEV distribution or whose excesses above u follow a GPD. The parameters of the GEV or GPD model depend on t:

Z_t & \sim \mbox{GEV}(\mu(t), \sigma(t), \xi(t))\\
Z_t & \sim \mbox{GPD}(\sigma(t), \xi(t), u)

Then, the standardized variables \hat{Z}_t defined respectively by:

\hat{Z}_t & = \dfrac{1}{\xi(t)} \log \left[1 + \xi(t)\left( \dfrac{Z_t-\mu(t)}{\sigma(t)} \right)\right] \\
\hat{Z}_t & = \dfrac{1}{\xi(t)} \log \left[1 + \xi(t)\left( \dfrac{Z_t-u}{\sigma(t)}      \right)\right]

respectively follows the standard Gumbel distribution (which is the GEV model with (\mu, \sigma, \xi) = (0, 1, 0)) or the standard Exponential distribution (which is the GPD with (\sigma, \xi, u) = (1, 0, 0)).

Then, the 4 usual diagnostic graphs are built from the transformed data compared to the Gumbel or Exponential model:

  • the probability-probability plot,

  • the quantile-quantile plot,

  • the return level plot,

  • the data histogram with the Gumbel/Exponential distribution.

If (\hat{z}_{(1)}, \dots, \hat{z}_{(n)}) denotes the ordered transformed data, the graphs are defined as follows.

The probability-probability plot consists of the points (respectively for the GEV and GPD models):

\left\{ \left( i/(n+1),\exp (-\exp (-\hat{z}_{(i)})) \right), i=1, \dots , n\right\}\\
\left\{ \left( i/(n+1), 1- \exp(-\tilde{z}_{(i)})    \right), i=1, \dots , n\right\}

The quantile-quantile plot consists of the points (respectively for the GEV and GPD models):

\left\{  \left(  \hat{z}_{(i)},  -\log(-\log(i/(n+1)))  \right), i=1, \dots , n\right\} \\
\left\{ \left(   \tilde{z}_{(i)}, -\log(1-i/(n+1))      \right), i=1, \dots , n\right\}

The return level plot consists of the points:

\left\{ \left( m, \hat{z}_m \right), m> 0 \right\}

and the points:

\left\{ \left( m, \hat{z}_{m}^{emp} \right), m> 0 \right\}

where \hat{z}_{m}^{emp} is the empirical m-block return level (for the GEV model) or the m-observation return level (for the GPD model) of the transformed data and \hat{z}_{m} the same quantity evaluated from the Gumbel/Exponential distribution.

drawParameterFunction(parameterIndex=0)

Draw the parameter function.

Parameters:
parameterIndexint,

The index q specifying the component of \theta_q.

Returns:
graphGraph

Graph of t \mapsto \theta_q(t).

drawQuantileFunction(p)

Draw the quantile function.

Parameters:
pfloat

The quantile level.

Returns:
graphGraph

Quantile function graph.

Notes

The quantile function is the function t \mapsto q_p(t) where q_p(t) is the quantile of order p of the Parent distribution at time t.

getClassName()

Accessor to the object’s name.

Returns:
class_namestr

The object class name (object.__class__.__name__).

getDistribution(t)

Accessor to the Parent distribution at a given time.

Parameters:
tfloat

Time value.

Returns:
distributionDistribution

The Parent distribution at time t.

getLogLikelihood()

Optimal log-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:
normalizeFunctionFunction

The function t \mapsto \tau(t).

getOptimalParameter()

Optimal parameter accessor.

Returns:
optimalParameterPoint

Optimal vector of parameters \vect{\beta}.

getParameterDistribution()

Accessor to the distribution of \vect{\beta}.

Returns:
parameterDistributionDistribution

The distribution of the estimator of \vect{\beta}.

getParameterFunction()

Parameter function accessor.

Returns:
parameterFunctionFunction

The function t \mapsto \vect{\theta}(t).

getTimeGrid()

Accessor to the time grid.

Returns:
timeGridSample

Values of t.

hasName()

Test if the object is named.

Returns:
hasNamebool

True if the name is not empty.

setLogLikelihood(logLikelihood)

Optimal log-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 \vect{\beta}.

Parameters:
parameterDistributionDistribution

The distribution of the estimator of \vect{\beta}.

Examples using the class

Estimate a GEV on the Port Pirie sea-levels data

Estimate a GEV on the Port Pirie sea-levels data

Estimate a GPD on the daily rainfall data

Estimate a GPD on the daily rainfall data

Estimate a GEV on race times data

Estimate a GEV on race times data

Estimate a GEV on the Fremantle sea-levels data

Estimate a GEV on the Fremantle sea-levels data