Functions
Diagnostic plots
ExtremePlots.mrlplot — Functionmrlplot(y::Vector{<:Real}, steps::Int = 100)Mean residual plot
ExtremePlots.probplot — Methodprobplot(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 fromDistributions.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)ExtremePlots.qqplot — Methodqqplot(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: Iftrue(default), quantiles are matched via interpolation based on ECDF. Iffalse, 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.
ExtremePlots.qqplot — Methodqqplot(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 fromDistributions.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)ExtremePlots.returnlevelplot — Methodreturnlevelplot(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 fromDistributions.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")Diagnostic plots for the Extremes.jl structures
ExtremePlots.diagnosticplots — Methoddiagnosticplots(fm::AbstractFittedExtremeValueModel)Diagnostic plots
ExtremePlots.qqplotci — Functionqqplotci(fm::AbstractFittedExtremeValueModel, α::Real = 0.05;
title::String = "",
xlabel::String = "Model quantile",
ylabel::String = "Empirical quantile")Generates a Quantile-Quantile (QQ) plot with pointwise confidence or credible intervals for a fitted extreme value model.
The plot compares the empirical quantiles to the model-predicted quantiles, and adds pointwise confidence intervals of level 1 - α.
Arguments
fm: A fitted extreme value model (AbstractFittedExtremeValueModel)α: Significance level for the interval (default:0.05)title: Plot titlexlabel,ylabel: Axis labels
Returns
- A
Gadfly.Plotobject
Notes
- This function is currently only available for stationary models (i.e., with no covariates).
See also
Example
```julia using Distributions, Extremes
pd = GeneralizedExtremeValue(0, 1, 0) y = rand(pd, 300) fm = gevfit(y)
qqplotci(fm)
ExtremePlots.returnlevelplotci — Functionreturnlevelplotci(fm::AbstractFittedExtremeValueModel, α::Real = 0.05;
title::String = "",
xlabel::String = "Return period",
ylabel::String = "Return level")Generates a return level plot with pointwise confidence or credible intervals for a fitted extreme value model.
Details
The return level plot displays the empirical and model-based return levels against return periods on a logarithmic x-axis, with confidence intervals of level 1 - α.
Arguments
fm: A fitted extreme value model (AbstractFittedExtremeValueModel)α: Significance level for the confidence interval (default:0.05)title: Title of the plot (optional)xlabel,ylabel: Axis labels (optional)
Returns
- A
Gadfly.Plotobject showing:- Empirical return levels (points)
- Model-predicted return levels (dashed line)
- Confidence or credible interval (shaded ribbon)
Notes
- This function is currently only available for stationary models (i.e., without covariates).
- Return periods are displayed on a base-10 logarithmic scale.
See also
Example
```julia using Distributions, Extremes
pd = GeneralizedExtremeValue(0, 1, 0) y = rand(pd, 300) fm = gevfit(y)
returnlevelplotci(fm)