Functions

Diagnostic plots

ExtremePlots.probplotMethod
probplot(pd::Distribution, y::AbstractVector{<:Real})

Generate a probability–probability plot comparing the empirical distribution of y against the theoretical distribution pd.

Details

Arguments

  • pd: A univariate probability distribution from Distributions.jl.
  • y: A sample vector of real-valued observations.

Returns

A Gadfly.Plot object.

Example

using Distributions, ExtremePlots

y = rand(Gumbel(), 100)
p = probplot(Gumbel(), y)
source
ExtremePlots.qqplotMethod
qqplot(x::AbstractVector{<:Real}, y::AbstractVector{<:Real};
       interpolation::Bool=true, title::String="",
       xlabel::String="Empirical quantiles", ylabel::String="Empirical quantiles")

Create a quantile-quantile plot comparing two empirical distributions.

Details

Arguments

  • x: Reference data vector, used to compute theoretical or sample quantiles.
  • y: Observed data vector to be compared.
  • interpolation: If true (default), quantiles are matched via interpolation based on ECDF. If false, the shortest length is sampled from both vectors without replacement and sorted.
  • title: Title of the plot.
  • xlabel: Label for the x-axis (default: "Empirical quantiles").
  • ylabel: Label for the y-axis (default: "Empirical quantiles").

Returns

A Gadfly plot object.

source
ExtremePlots.qqplotMethod
qqplot(pd::Distribution, y::AbstractVector{<:Real})

Generate a quantile-quantile plot comparing the empirical qunatile of y against the theoretical quantiles of pd.

Details

Arguments

  • pd: A univariate probability distribution from Distributions.jl.
  • y: A sample vector of real-valued observations.

Returns

A Gadfly.Plot object.

Example

using Distributions, ExtremePlots

y = rand(Gumbel(), 100)
p = qqplot(Gumbel(), y)
source
ExtremePlots.returnlevelplotMethod
returnlevelplot(pd::Distribution, y::AbstractVector{<:Real}; title::String="")

Generate a return level plot comparing empirical return levels with theoretical return levels from a fitted probability distribution.

Details

Arguments

  • pd: A univariate distribution from Distributions.jl, representing the theoretical model.
  • y: A vector of real-valued observations (e.g., annual maxima).
  • title: (Optional) Title for the plot.

Returns

A Gadfly.Plot object showing:

  • Points: Empirical return levels computed using the Gumbel plotting position.
  • Dashed Line: Theoretical return levels computed from the quantile function of pd.

Example

using Gadfly, Distributions
y = rand(Gumbel(0, 1), 100)
returnlevelplot(Gumbel(0, 1), y, title="Return level plot")
source

Diagnostic plots for the Extremes.jl structures

Utility functions