Sea-Level hazard

Currently sea-level hazards in DIVACoast.jl are represented trough extreme still water level distributions. These distributions are implemented as Distributions of the Julia Package Distributions.jl. As ESL are often provided as non-parametric (i.e. empirical) distributions, i.e. point-wise as a list of water levels and associated return periods, DIVACoast.jl provides a couple of functions that convert these non-parametric distributions to a chosen parametric extreme value distribution.

Main.DIVACoast.estimate_gumbel_distributionFunction

This function tries to fit a gumbel distribution to given data. wldata is the actual data (e.g. water level). cdfdata are the empirical cdf values for the data in x (i.e. values between 0 and 1 - to be interpreted as quantiles). The funtion returns a GeneralizedExtremeValue (GEV) with the third (shape, ξ) parameter being zero. If the cdf fit fails for any reason, the standard gumbel distribution (μ=mean(data), σ=var(data), ξ=0.0) is returned

Main.DIVACoast.estimate_frechet_distributionFunction

This function fits a Frechet Distribution to the inserted data. y should be the return period and x the corresponding water level height. The funtion returns a GeneralizedExtremeValue (GEV).

This function tries to fit a Frechet distribution to given data. x is the actual data (e.g. water level). y are the empirical cdf values for the data in x (i.e. values between 0 and 1 - to be interpreted as quantiles). The funtion returns a GeneralizedExtremeValue (GEV) with the third (shape, ξ) parameter being bigger than zero. If the cdf fit fails for any reason, a standard Frechet distribution (μ=mean(data), σ=var(data), ξ=0.5) is returned

Main.DIVACoast.estimate_gev_distributionFunction

This function fits an extreme value distribution to the inserted data. y should be the return period and x the corresponding water level height. The funtion returns a GeneralizedExtremeValue (GEV) and uses the best fit out of the Gumbel, Frechet and Weibull model based on the summed squared residuals.

Main.DIVACoast.estimate_weibull_distributionFunction

This function fits a Weibull Distribution to the inserted data. y should be the return period and x the corresponding water level height. The funtion returns a GeneralizedExtremeValue (GEV).

This function tries to fit a Weibull distribution to given data. 
    x is the actual data (e.g. water level).
    y are the cempirical df values for the data in x (i.e. values between 0 and 1 - to be interpreted as quantiles). 
The funtion returns a GeneralizedExtremeValue (GEV) with the third (shape, ξ) parameter being smaller than zero. If the cdf fit fails for any reason, 
a standard Weibull distribution (μ=mean(data), σ=var(data), ξ=-0.5) is returned
Main.DIVACoast.estimate_gpd_negative_distributionFunction

This function fits a Generalized Pareto Distribution with negative shape to the inserted data. y should be the return period and x the corresponding water level height. The funtion returns a GeneralizedPareto (GPD).

Main.DIVACoast.estimate_gpd_positive_distributionFunction

This function fits a gpd_positive Distribution to the inserted data. y should be the return period and x the corresponding water level height. The funtion returns a GeneralizedExtremeValue (GEV).

Main.DIVACoast.estimate_gp_distributionFunction

This function fits an extreme value distribution to the inserted data. y should be the return period and x the corresponding water level height. The funtion returns a GeneralizedPareto (GPD) and uses the best fit out of the exponential, positive GPD and negative GPD model based on the summed squared residuals.

Main.DIVACoast.estimate_exponential_distributionFunction

This function tries to fit an exponential distribution to given data. x is the actual data (i.e. water level). y are the cdf values for the data in x (i.e. values between 0 and 1). The funtion returns a GeneralizedPareto (GPD) with the third shape parameter being zero. If the cdf fit fails for any reason, the standard exponential distribution (μ=0) is returned

Main.DIVACoast.plot_comparison_extreme_distributionsFunction
plot_comparison_extreme_distributions(x_data::Array{T}, y_data::Array{T})

This function creates a plot that compares six different extreme distribution fits to underlying data. The input is an xdata and ydata array, xdata is the absolute height of extremes and ydata is the annual probability to be below this value. The function fits three different GEV and three different GPD functions to the data and plots all of these. It also highlights the best fit out of these six functions and highlights this in the plot.

Distributions.cdfFunction
Distributions.cdf(d::LinInt, x::Real)

Cumulative distribution function.

Distributions.supportFunction
support(d::LinInt)

Get a sorted AbstractVector defining the support of d.

Distributions.probsFunction
probs(d::LinInt)

Get the vector of probabilities associated with the support of d.

Base.randFunction
Base.rand(d::LinInt)

Generate a random number.

Base.rand(d::LinInt,n::Int64)

Generate a vextor of n random numbers

Statistics.quantileFunction

" Distributions.quantile(d::LinInt, x::Real) Evaluate the (generalized) inverse cumulative distribution function at q, also called quantile function.

Instead of fitting parametric extreme value distributions to the point-wise list of water levels and associated return periods, DIVACoast.jl also provides a linear interpolation option.

Main.DIVACoast.LinIntType
LinInt(xs, ps)

A Linear Interpolation creates a linear interpolation between data points and uses a flat extrapolation beyond the range of input data points, i.e. stays constant at the last value.

d = LinInt(xs, ps)

support(d) # Get a sorted AbstractVector describing the support (xs) of the distribution
probs(d)   # Get a Vector of the probabilities (ps) associated with the support
Main.DIVACoast.linear_interpFunction
linear_interp(x_vals, y_vals, x_query)

This function returns the interpolated y value for xquery based on a linear interpolation between data points xvals and y_vals and uses a flat extrapolation beyond the range of input data points.

linear_interp([2.1, 2.5, 3.4], [0.9, 0.99, 0.999], 3.0)
Main.DIVACoast.manual_integrationFunction
Manual integration using single trapezoidal approximation for function f() using LinInt as separators for trapezoids and lower integral boundary a and higher boundary b.

An InundationModel defines how the flood extent of an extreme still water level is determined.

Main.DIVACoast.InundationModelType
InundationModel(coast_length::DT, coast_length_unit::String,
elevations::Array{DT}, elevation_unit::String, area::Array{DT}, area_unit::String,
exposure_data::StructArray{T1}, exposure_units::Array{String}) where {DT<:Real,T1}

An InundationModel represents the model type used to model water inundation over a HypsometricProfile. BathtubInundation uses the bathtub approach and LinearDistanceAttenuatedInundation uses a linear factor to attenuate the water level.

To get the flood extent under an extreme still water level on a hypsometric profile for a specific InundationModel, one can use the following function.

Main.DIVACoast.inundateFunction
function inundate(hspf::HypsometricProfile, wl::Number, im::IM)  where {DT<:Real,IM<:InundationModel}

The inundate function models the flood inundation for each elevation of a given HypsometricProfile and a given water level and InundationModel.

output: tuple of two arrays, first array gives elevation, second one water level per respective elevation (the arrays stop when no inundation happens)

Arguments

  • hspf::HypsometricProfile: the hypsometric profile object which will be flooded.
  • wl::Number: the water level that is propagated on the hypsometric profile.
  • im::IM: the inundation model defining how the water is propagated on the hypsometric profile.

Output

  • two tuple of arrays, the first array returns the elevation of the hypsometric profile, the second array returns the water level per respective elevation (the arrays stop when no inundation happens)

Example

inundate(hspf, 2.0, BathtubInundation)