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")