This page demonstrates how to use the diagnostic plots from the ExtremePlots.jl package with the data structures provided by Extremes.jl.
Load the required packages:
using Distributions, Extremes, ExtremePlots, Gadfly
Simulate data from a Generalized Extreme Value (GEV) distribution:
pd = GeneralizedExtremeValue(0,1,0)
y = rand(pd, 300);
Fit the block maxima model by maximum likelihood:
fm = gevfit(y)
MaximumLikelihoodAbstractExtremeValueModel
model :
BlockMaxima{GeneralizedExtremeValue}
data : Vector{Float64}[300]
location : μ ~ 1
logscale : ϕ ~ 1
shape : ξ ~ 1
θ̂ : [-0.01753299188548797, 0.026174238797756186, 0.024881554077077973]
Displays a histogram of the data with the distribution overlay.
ExtremePlots.histplot(fm)
Compares empirical and model probabilities.
ExtremePlots.probplot(fm)
Compares empirical and model quantiles.
ExtremePlots.qqplot(fm)
Displays empirical and model-predicted return levels as a function of the return period.
ExtremePlots.returnlevelplot(fm)
Compiles in a panel the diagnostic plots
Gadfly.set_default_plot_size(21cm ,16cm)
ExtremePlots.diagnosticplots(fm)