Background

The user defined functions for the LP3 and GEV distributions provided in the workbooks follow the conventional notation used by Excel for probability distribution functions. The notation and usage is similar to the NORM.DIST and NORM.INV functions.

Given a set of LP3 parameters (μ, σ, γ) that define a frequency curve, the value of AEP that corresponds to a given value of flow (Q) can be calculated using the following formulas and user defined function.

F(x) = LP3_DIST(Log(Q), μ, σ, γ, TRUE)

AEP = 1 – F(x)

Given a set of LP3 parameters (μ, σ, γ) that define a frequency curve, the value of flow (Q) that corresponds to a given value of AEP can be calculated using the following formulas and user defined function.

F-1(x) = LP3_INV(1-AEP, μ, σ, γ)

Q = 10^ F-1(x) 

Given a set of LP3 parameters (μ, σ, γ) that define a frequency curve, the probability density for a given value of flow (Q) on the LP3 frequency curve can be calculated using the following formulas and user defined function.

f(x) = LP3_DIST(Log(Q), μ, σ, γ, FALSE)

The equation for the probability density of an LP3 frequency curve is shown below where τ is the location, α is the shape, β is the scale, and Γ is the gamma function. The letter ζ is sometimes used in the literature to define the location parameter.

https://en.wikipedia.org/wiki/Gamma_distribution

https://en.wikipedia.org/wiki/Gamma_function 

$f(x \mid \tau, \alpha, \beta)=\frac{\left(\frac{x-\tau}{\beta}\right)^{\alpha-1} \exp \left(-\frac{x-\tau}{\beta}\right)}{|\beta| \Gamma(\alpha)}$

The location, shape, and scale parameters are related to the mean, standard deviation, and skew. The user defined function calculates the location, shape, and scale based on the user inputs for the mean, standard deviation, and skew using the equations below.

$\tau=\mu-\alpha \beta$

$\alpha=\frac{4}{\gamma^{2}}$

$\beta=\operatorname{sgn}(\gamma) \sqrt{\frac{\sigma^{2}}{\alpha}}$

When skew is positive, the lower bound of the LP3 frequency curve is equal to τ. When skew is negative, the upper bound of the LP3 frequency curve is equal to τ.

There are five scenarios needed to calculate F(x), F-1(x), and f(x) depending on whether skew is positive, negative, or zero and depending on whether X=Log(Q) is within the support of the distribution. Within the support means that X is not greater than τ when skew is negative and X is not less than τ when skew is positive.

Skew values that are "practically zero" are assumed to be equal to zero (-ε < γ < +ε). The user defined functions define "practically zero" as ε=0.001. When skew is practically zero, the LP3 equations cannot be used because the value of α is undefined when skew is equal to zero. When skew is practically zero, the distribution becomes log-normal and the corresponding equations for a log-normal distribution are used.

When skew is positive, the user defined functions use the following equations:

  • F-1(x) = τ + GAMMA.INV(1-AEP, α, β)
  • If X > tau then
    • F(x) = GAMMA.DIST(Log(Q) – τ, α, β, TRUE)
    • f(x) = GAMMA.DIST(Log(Q) – τ, α, β, FALSE)
  • If X <= tau then
    • F(x) = 0
    • f(x) = 0

When skew is negative, the user defined functions use the following equations:

  • F-1(x) = τ - GAMMA.INV(1-AEP, α, ABS(β))
  • If X < tau then
    • F(x) = GAMMA.DIST(τ - Log(Q), α, ABS(β), TRUE)
    • f(x) = GAMMA.DIST(τ - Log(Q), α, ABS(β), FALSE)
  • If X >= tau then
    • F(x) = 1
    • f(x) = 0

When skew is practically zero, the user defined functions use the following equations. When skew is zero, the LP3 becomes a log-normal distribution.

  • F(x) = NORM.DIST(Log(Q), μ, σ, TRUE)
  • F-1(x) = NORM.INV(1-AEP, μ, σ)
  • f(x) = NORM.DIST(Log(Q), μ, σ, FALSE)

Given a set of GEV parameters (ζ, α, κ) that define a frequency curve, the value of AEP that corresponds to a given value of precipitation (X) can be calculated using the following formulas and user defined function.

  • F(x) = GEV_DIST(X, ζ, α, κ, TRUE)
  • AEP = 1 – F(x)

Given a set of GEV parameters (ζ, α, κ) that define a frequency curve, the value of precipitation (X) that corresponds to a given value of AEP can be calculated using the following formulas and user defined function.

  • F-1(x) = GEV_INV(1-AEP, ζ, α, κ)
  • P = 10^ F-1(x) 

Given a set of GEV parameters (ζ, α, κ) that define a frequency curve, the probability density for a given value of precipitation (X) can be calculated using the following formulas and user defined function.

  • f(x) = LP3_DIST(X, ζ, α, κ, FALSE)

The equation for the probability density of a GEV frequency curve is shown below where ζ is the location, α is the scale, and κ is the shape. This parameterization (or format) for the equation can be found in Hosking and Wallis (1997). There are alternative formats that can be found in other literature. For this reason, it is important to make sure the correct parameterization is being used.

$f(x \mid \xi, \alpha, \kappa)=\frac{1}{\alpha} e^{-(1-\kappa) z-e^{-z}}$

$\left\{\begin{array}{ll}z=-\frac{1}{\kappa} \ln \left(1-\kappa\left(\frac{x-\xi}{\alpha}\right)\right) & \text { if } \kappa \neq 0 \\ z=\frac{x-\xi}{\alpha} & \text { if } \kappa=0\end{array}\right.$

When shape is positive, the upper bound of the GEV frequency curve is equal to ζ + α/κ.  When shape is negative, the lower bound of the GEV frequency curve is equal to ζ + α/κ.  A GEV frequency curve with a positive shape parameter will have a concave down shape.  A GEV frequency curve with a negative shape parameter will have a concave up shape.

There are five scenarios needed to calculate F(x), F-1(x), and f(x) depending on whether shape (κ) is positive, negative, or zero and depending on whether X is within the support of the distribution.

Shape values that are practically zero are assumed to be equal to zero (-ε < κ < +ε). The user defined functions define practically zero as ε=0.001. When shape is practically zero, the GEV equations cannot be used because the value of z is undefined when shape is equal to zero. When shape is practically zero, the distribution becomes a GEV Type-1 or Gumbel distribution and the corresponding equations for a Gumbel distribution are used.

When shape is positive, the user defined functions use the following equations:

  • F-1(x) = ζ + α/κ*(1 – (-1 *LN(1-AEP) ^ κ)
  • If X < ζ + α/κ then
    • F(x) = EXP(-1*EXP(-1*Z))
    • f(x) = 1/α*EXP(-1*(1-κ)*Z – EXP(-1*Z))
  • If X >= ζ + α/κ then
    • F(x) = 1
    • f(x) = 0

When shape is negative, the user defined functions use the following equations:

  • F-1(x) = ζ + α/κ*(1 – (-1 *LN(1-AEP) ^ κ)
  • If X > ζ + α/κ then
    • F(x) = EXP(-1*EXP(-1*Z))
    • f(x) = 1/α*EXP(-1*(1-κ)*Z – EXP(-1*Z))
  • If X <= ζ + α/κ then
    • F(x) = 0
    • f(x) = 0

When shape is practically zero, the user defined functions use the following equations:

  • F-1(x) = ζ – α*LN(-1*LN(1-AEP))
  • F(x) = EXP(-1*EXP(-1*Z))
  • f(x) = 1/α*EXP(-1*(1-κ)*Z – EXP(-1*Z))

Exercise

Question 10. Given an LP3 distribution with a mean of μ=3.5, a standard deviation of σ=0.22, and a skew of γ=+0.1, manually calculate the flow for the 0.001 AEP using the equations above without using any of the user defined functions.

Parameter

Value

AEP

0.001

α

400

β

0.011

τ

-0.9

F-1(x)

4.211

Q

16,300


Question 11. Given a GEV distribution with a location of ζ=3.0, a scale of α=1.0, and a shape of κ=-0.1, manually calculate the AEP for a precipitation of 8.8 inches using the equations above without using any of the user defined functions.

Parameter

Value

Precipitation (X)

8.8

ζ + α/κ

-7.0

Z

4.574

F(x)

0.990

AEP

0.01