Non-Stationary Block Maxima Model

In the non-stationary block maxima model, the GEV parameters are allowed to be functions of multiple covariates:

\[ μ = X₁ × β₁ \\ ϕ = X₂ × β₂ \\ ξ = X₃ × β₃ \]

where $(X₁,β₁)$, $(X₂,β₂)$ and $(X₃,β₃)$ are respectively the design matrix and the corresponding coefficient parameter vector of $μ$, $ϕ$ and $ξ$.

Intercept

An intercept is included in all parameter functions by default.

The non-stationary BlockMaxima model is illustrated using the annual maximum sea-levels recorded at Fremantle in West Australia from 1897 to 1989, studied by Coles (2001) in Chapter 6.

Load the data

Loading the annual maximum sea-levels at Fremantle:

data = Extremes.dataset("fremantle")
first(data,5)
5×3 DataFrame
RowYearSeaLevelSOI
Int64Float64Float64
118971.58-0.67
218981.710.57
318991.40.16
419001.34-0.65
519011.430.06

The annual maxima can be plotted as function of the year:

plot(data, x=:Year, y=:SeaLevel, Geom.line,
    Coord.cartesian(xmin=1895, xmax=1990), Guide.xticks(ticks=1895:10:1990))
Year 1895 1905 1915 1925 1935 1945 1955 1965 1975 1985 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? 1.0 1.5 2.0 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 1.000 1.005 1.010 1.015 1.020 1.025 1.030 1.035 1.040 1.045 1.050 1.055 1.060 1.065 1.070 1.075 1.080 1.085 1.090 1.095 1.100 1.105 1.110 1.115 1.120 1.125 1.130 1.135 1.140 1.145 1.150 1.155 1.160 1.165 1.170 1.175 1.180 1.185 1.190 1.195 1.200 1.205 1.210 1.215 1.220 1.225 1.230 1.235 1.240 1.245 1.250 1.255 1.260 1.265 1.270 1.275 1.280 1.285 1.290 1.295 1.300 1.305 1.310 1.315 1.320 1.325 1.330 1.335 1.340 1.345 1.350 1.355 1.360 1.365 1.370 1.375 1.380 1.385 1.390 1.395 1.400 1.405 1.410 1.415 1.420 1.425 1.430 1.435 1.440 1.445 1.450 1.455 1.460 1.465 1.470 1.475 1.480 1.485 1.490 1.495 1.500 1.505 1.510 1.515 1.520 1.525 1.530 1.535 1.540 1.545 1.550 1.555 1.560 1.565 1.570 1.575 1.580 1.585 1.590 1.595 1.600 1.605 1.610 1.615 1.620 1.625 1.630 1.635 1.640 1.645 1.650 1.655 1.660 1.665 1.670 1.675 1.680 1.685 1.690 1.695 1.700 1.705 1.710 1.715 1.720 1.725 1.730 1.735 1.740 1.745 1.750 1.755 1.760 1.765 1.770 1.775 1.780 1.785 1.790 1.795 1.800 1.805 1.810 1.815 1.820 1.825 1.830 1.835 1.840 1.845 1.850 1.855 1.860 1.865 1.870 1.875 1.880 1.885 1.890 1.895 1.900 1.905 1.910 1.915 1.920 1.925 1.930 1.935 1.940 1.945 1.950 1.955 1.960 1.965 1.970 1.975 1.980 1.985 1.990 1.995 2.000 1 2 SeaLevel

and as function of the Southern Oscillation Index:

plot(data, x=:SOI, y=:SeaLevel, Geom.point)
SOI -2 -1 0 1 2 3 -2.0 -1.8 -1.6 -1.4 -1.2 -1.0 -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 -2.00 -1.98 -1.96 -1.94 -1.92 -1.90 -1.88 -1.86 -1.84 -1.82 -1.80 -1.78 -1.76 -1.74 -1.72 -1.70 -1.68 -1.66 -1.64 -1.62 -1.60 -1.58 -1.56 -1.54 -1.52 -1.50 -1.48 -1.46 -1.44 -1.42 -1.40 -1.38 -1.36 -1.34 -1.32 -1.30 -1.28 -1.26 -1.24 -1.22 -1.20 -1.18 -1.16 -1.14 -1.12 -1.10 -1.08 -1.06 -1.04 -1.02 -1.00 -0.98 -0.96 -0.94 -0.92 -0.90 -0.88 -0.86 -0.84 -0.82 -0.80 -0.78 -0.76 -0.74 -0.72 -0.70 -0.68 -0.66 -0.64 -0.62 -0.60 -0.58 -0.56 -0.54 -0.52 -0.50 -0.48 -0.46 -0.44 -0.42 -0.40 -0.38 -0.36 -0.34 -0.32 -0.30 -0.28 -0.26 -0.24 -0.22 -0.20 -0.18 -0.16 -0.14 -0.12 -0.10 -0.08 -0.06 -0.04 -0.02 0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20 0.22 0.24 0.26 0.28 0.30 0.32 0.34 0.36 0.38 0.40 0.42 0.44 0.46 0.48 0.50 0.52 0.54 0.56 0.58 0.60 0.62 0.64 0.66 0.68 0.70 0.72 0.74 0.76 0.78 0.80 0.82 0.84 0.86 0.88 0.90 0.92 0.94 0.96 0.98 1.00 1.02 1.04 1.06 1.08 1.10 1.12 1.14 1.16 1.18 1.20 1.22 1.24 1.26 1.28 1.30 1.32 1.34 1.36 1.38 1.40 1.42 1.44 1.46 1.48 1.50 1.52 1.54 1.56 1.58 1.60 1.62 1.64 1.66 1.68 1.70 1.72 1.74 1.76 1.78 1.80 1.82 1.84 1.86 1.88 1.90 1.92 1.94 1.96 1.98 2.00 2.02 2.04 2.06 2.08 2.10 2.12 2.14 2.16 2.18 2.20 2.22 2.24 2.26 2.28 2.30 2.32 2.34 2.36 2.38 2.40 2.42 2.44 2.46 2.48 2.50 2.52 2.54 2.56 2.58 2.60 2.62 2.64 2.66 2.68 2.70 2.72 2.74 2.76 2.78 2.80 2.82 2.84 2.86 2.88 2.90 2.92 2.94 2.96 2.98 3.00 -3 0 3 0.61,1.51 0.73,1.7 -1.47,1.46 -0.32,1.56 -0.07,1.57 -0.14,1.62 -0.94,1.67 -1.44,1.43 0.06,1.61 -0.43,1.46 -0.08,1.37 -0.3,1.8 -1.13,1.4 0.06,1.7 1.32,1.9 0.97,1.6 0.63,1.5 -0.88,1.6 1.06,1.46 0.28,1.71 -0.66,1.62 0.19,1.77 0.25,1.58 -0.53,1.46 -0.97,1.62 0.53,1.83 -0.32,1.68 0.38,1.62 -0.01,1.46 0.28,1.43 -0.11,1.46 -0.5,1.62 -0.45,1.58 1.0,1.86 0.89,1.62 0.23,1.49 -0.76,1.52 -0.23,1.52 -0.69,1.49 1.49,1.65 -0.21,1.58 -0.24,1.52 0.16,1.46 -0.79,1.49 0.42,1.71 -0.27,1.55 0.35,1.49 -1.44,1.43 -1.52,1.31 0.02,1.62 0.86,1.37 0.09,1.34 0.03,1.58 0.14,1.49 -0.01,1.62 0.09,1.43 -0.68,1.55 0.39,1.74 0.03,1.71 0.46,1.46 0.43,1.62 0.27,1.74 -0.24,1.34 0.33,1.46 -0.36,1.49 0.33,1.37 0.66,1.65 0.08,1.49 -1.09,1.58 0.05,1.52 2.12,1.52 0.62,1.28 0.16,1.4 -0.92,1.19 -0.97,1.37 0.28,1.92 0.28,1.46 0.2,1.37 -1.78,1.34 0.39,1.55 0.47,1.19 0.06,1.43 -0.65,1.34 0.16,1.4 0.57,1.71 -0.67,1.58 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? 1.0 1.5 2.0 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 1.000 1.005 1.010 1.015 1.020 1.025 1.030 1.035 1.040 1.045 1.050 1.055 1.060 1.065 1.070 1.075 1.080 1.085 1.090 1.095 1.100 1.105 1.110 1.115 1.120 1.125 1.130 1.135 1.140 1.145 1.150 1.155 1.160 1.165 1.170 1.175 1.180 1.185 1.190 1.195 1.200 1.205 1.210 1.215 1.220 1.225 1.230 1.235 1.240 1.245 1.250 1.255 1.260 1.265 1.270 1.275 1.280 1.285 1.290 1.295 1.300 1.305 1.310 1.315 1.320 1.325 1.330 1.335 1.340 1.345 1.350 1.355 1.360 1.365 1.370 1.375 1.380 1.385 1.390 1.395 1.400 1.405 1.410 1.415 1.420 1.425 1.430 1.435 1.440 1.445 1.450 1.455 1.460 1.465 1.470 1.475 1.480 1.485 1.490 1.495 1.500 1.505 1.510 1.515 1.520 1.525 1.530 1.535 1.540 1.545 1.550 1.555 1.560 1.565 1.570 1.575 1.580 1.585 1.590 1.595 1.600 1.605 1.610 1.615 1.620 1.625 1.630 1.635 1.640 1.645 1.650 1.655 1.660 1.665 1.670 1.675 1.680 1.685 1.690 1.695 1.700 1.705 1.710 1.715 1.720 1.725 1.730 1.735 1.740 1.745 1.750 1.755 1.760 1.765 1.770 1.775 1.780 1.785 1.790 1.795 1.800 1.805 1.810 1.815 1.820 1.825 1.830 1.835 1.840 1.845 1.850 1.855 1.860 1.865 1.870 1.875 1.880 1.885 1.890 1.895 1.900 1.905 1.910 1.915 1.920 1.925 1.930 1.935 1.940 1.945 1.950 1.955 1.960 1.965 1.970 1.975 1.980 1.985 1.990 1.995 2.000 1 2 SeaLevel

Both variables can be included in the block maxima model. Parameter estimation can be performed either by maximum likelihood or by the Bayesian approach. Probability weighted moment estimation cannot be used in the non-stationary case.

Maximum likelihood inference

GEV parameter estimation

The GEV parameter estimation with maximum likelihood is performed with the gevfit function. The parameter estimate vector $\mathbf{θ̂} = (\mathbf{β̂₁},\, \mathbf{β̂₂},\, \mathbf{β̂₃})^\top$ is contained in the field θ̂ of the returned structure.

Several non-stationary model can be fitted.

The stationary model

julia> fm₀ = gevfit(data, :SeaLevel)MaximumLikelihoodAbstractExtremeValueModel
model :
	BlockMaxima{GeneralizedExtremeValue}
	data :		Vector{Float64}[86]
	location :	μ ~ 1
	logscale :	ϕ ~ 1
	shape :		ξ ~ 1

θ̂  :	[1.4823411063972953, -1.957072887171364, -0.21742418585608772]

The location parameter varying as a linear function of the year

julia> fm₁ = gevfit(data, :SeaLevel, locationcovid = [:Year])MaximumLikelihoodAbstractExtremeValueModel
model :
	BlockMaxima{GeneralizedExtremeValue}
	data :		Vector{Float64}[86]
	location :	μ ~ 1 + Year
	logscale :	ϕ ~ 1
	shape :		ξ ~ 1

θ̂  :	[-2.4727880606816433, 0.00203216246147196, -2.084849395454593, -0.12530315168965786]

The location parameter varying as a linear function of the year and the SOI

julia> fm₂ = gevfit(data, :SeaLevel, locationcovid = [:Year, :SOI])MaximumLikelihoodAbstractExtremeValueModel
model :
	BlockMaxima{GeneralizedExtremeValue}
	data :		Vector{Float64}[86]
	location :	μ ~ 1 + Year + SOI
	logscale :	ϕ ~ 1
	shape :		ξ ~ 1

θ̂  :	[-2.62599181296525, 0.002114032686702418, 0.054517690075681226, -2.114182020887254, -0.14998552392836614]

Both the location and logscale parameters varying as a linear function of the year and the SOI

julia> fm₃ = gevfit(data, :SeaLevel, locationcovid = [:Year, :SOI], logscalecovid = [:Year, :SOI])MaximumLikelihoodAbstractExtremeValueModel
model :
	BlockMaxima{GeneralizedExtremeValue}
	data :		Vector{Float64}[86]
	location :	μ ~ 1 + Year + SOI
	logscale :	ϕ ~ 1 + Year + SOI
	shape :		ξ ~ 1

θ̂  :	[-2.215213912601999, 0.0019067329692207917, 0.06592556257024981, 6.760912614047801, -0.004564874869909601, 0.26512520665238254, -0.22292401254869737]

As show by Coles (2001), the best model is the one where the location parameter varies as a linear function of the year and the SOI, the fm₂ in the present section.

The vector of the parameter estimates (location scale and shape) can be extracted with the function params:

julia> params(fm₂)86-element Vector{Tuple{Float64, Float64, Float64}}:
 (1.3478013413585301, 0.12073200543257417, -0.14998552392836614)
 (1.4175173097390779, 0.12073200543257417, -0.14998552392836614)
 (1.3972790894947504, 0.12073200543257417, -0.14998552392836614)
 (1.3552337932201515, 0.12073200543257417, -0.14998552392836614)
 (1.396055385860587, 0.12073200543257417, -0.14998552392836614)
 (1.4226357041650213, 0.12073200543257417, -0.14998552392836614)
 (1.4203883216456696, 0.12073200543257417, -0.14998552392836614)
 (1.3041989668681433, 0.12073200543257417, -0.14998552392836614)
 (1.414258025904695, 0.12073200543257417, -0.14998552392836614)
 (1.4228475064841544, 0.12073200543257417, -0.14998552392836614)
 ⋮
 (1.5651780007967813, 0.12073200543257417, -0.14998552392836614)
 (1.4855154983699614, 0.12073200543257417, -0.14998552392836614)
 (1.5148883760945049, 0.12073200543257417, -0.14998552392836614)
 (1.560616560841752, 0.12073200543257417, -0.14998552392836614)
 (1.5665468318337523, 0.12073200543257417, -0.14998552392836614)
 (1.555031442001534, 0.12073200543257417, -0.14998552392836614)
 (1.4944501311012035, 0.12073200543257417, -0.14998552392836614)
 (1.6165030819544042, 0.12073200543257417, -0.14998552392836614)
 (1.6120749918320252, 0.12073200543257417, -0.14998552392836614)

The location parameter with the function location:

julia> location(fm₂)86-element Vector{Float64}:
 1.3478013413585301
 1.4175173097390779
 1.3972790894947504
 1.3552337932201515
 1.396055385860587
 1.4226357041650213
 1.4203883216456696
 1.3041989668681433
 1.414258025904695
 1.4228475064841544
 ⋮
 1.5651780007967813
 1.4855154983699614
 1.5148883760945049
 1.560616560841752
 1.5665468318337523
 1.555031442001534
 1.4944501311012035
 1.6165030819544042
 1.6120749918320252

The scale parameter with the function Extremes.scale:

julia> scale(fm₂)86-element Vector{Float64}:
 0.12073200543257417
 0.12073200543257417
 0.12073200543257417
 0.12073200543257417
 0.12073200543257417
 0.12073200543257417
 0.12073200543257417
 0.12073200543257417
 0.12073200543257417
 0.12073200543257417
 ⋮
 0.12073200543257417
 0.12073200543257417
 0.12073200543257417
 0.12073200543257417
 0.12073200543257417
 0.12073200543257417
 0.12073200543257417
 0.12073200543257417
 0.12073200543257417

The shape parameter with the function shape:

julia> shape(fm₂)86-element Vector{Float64}:
 -0.14998552392836614
 -0.14998552392836614
 -0.14998552392836614
 -0.14998552392836614
 -0.14998552392836614
 -0.14998552392836614
 -0.14998552392836614
 -0.14998552392836614
 -0.14998552392836614
 -0.14998552392836614
  ⋮
 -0.14998552392836614
 -0.14998552392836614
 -0.14998552392836614
 -0.14998552392836614
 -0.14998552392836614
 -0.14998552392836614
 -0.14998552392836614
 -0.14998552392836614
 -0.14998552392836614

The approximate covariance matrix of the parameter estimates for this model can be obtained with the parametervar function:

julia> parametervar(fm₂)5×5 Matrix{Float64}:
  1.02181      -0.000524501   6.71532e-5    0.0127779    -0.0209508
 -0.000524501   2.69285e-7   -1.61708e-8   -6.4457e-6     1.05896e-5
  6.71532e-5   -1.61708e-8    0.00038545    0.000239274  -0.000355337
  0.0127779    -6.4457e-6     0.000239274   0.00703707   -0.00256783
 -0.0209508     1.05896e-5   -0.000355337  -0.00256783    0.00444377

Confidence intervals for the parameters are obtained with the cint function:

julia> cint(fm₂)5-element Vector{Vector{Float64}}:
 [-4.607209165945568, -0.6447744599849323]
 [0.0010969546332637297, 0.0031311107401411067]
 [0.01603794386329232, 0.09299743628807014]
 [-2.2785980179345966, -1.9497660238399117]
 [-0.2806398353854793, -0.019331212471252968]

In particular, the 95% confidence interval for the rise in annual maximum sea-levels per year is as follows:

julia> cint(fm₂)[2]2-element Vector{Float64}:
 0.0010969546332637297
 0.0031311107401411067

Diagnostic plots

Several diagnostic plots for assessing the accuracy of the GEV model fitted to the Fremantle data can be shown with the diagnosticplots function:

set_default_plot_size(21cm ,16cm)
diagnosticplots(fm₂)
h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? Data -2.5 0.0 2.5 5.0 7.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 -1.95 -1.90 -1.85 -1.80 -1.75 -1.70 -1.65 -1.60 -1.55 -1.50 -1.45 -1.40 -1.35 -1.30 -1.25 -1.20 -1.15 -1.10 -1.05 -1.00 -0.95 -0.90 -0.85 -0.80 -0.75 -0.70 -0.65 -0.60 -0.55 -0.50 -0.45 -0.40 -0.35 -0.30 -0.25 -0.20 -0.15 -0.10 -0.05 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00 4.05 4.10 4.15 4.20 4.25 4.30 4.35 4.40 4.45 4.50 4.55 4.60 4.65 4.70 4.75 4.80 4.85 4.90 4.95 5.00 5.05 5.10 5.15 5.20 5.25 5.30 5.35 5.40 5.45 5.50 5.55 5.60 5.65 5.70 5.75 5.80 5.85 5.90 5.95 6.00 6.05 6.10 6.15 6.20 6.25 6.30 6.35 6.40 6.45 6.50 6.55 6.60 6.65 6.70 6.75 6.80 6.85 6.90 6.95 -2.5 0.0 2.5 5.0 7.5 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? 0.0 0.1 0.2 0.3 0.4 0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20 0.22 0.24 0.26 0.28 0.30 0.32 0.34 0.36 0.38 0.40 0.000 0.002 0.004 0.006 0.008 0.010 0.012 0.014 0.016 0.018 0.020 0.022 0.024 0.026 0.028 0.030 0.032 0.034 0.036 0.038 0.040 0.042 0.044 0.046 0.048 0.050 0.052 0.054 0.056 0.058 0.060 0.062 0.064 0.066 0.068 0.070 0.072 0.074 0.076 0.078 0.080 0.082 0.084 0.086 0.088 0.090 0.092 0.094 0.096 0.098 0.100 0.102 0.104 0.106 0.108 0.110 0.112 0.114 0.116 0.118 0.120 0.122 0.124 0.126 0.128 0.130 0.132 0.134 0.136 0.138 0.140 0.142 0.144 0.146 0.148 0.150 0.152 0.154 0.156 0.158 0.160 0.162 0.164 0.166 0.168 0.170 0.172 0.174 0.176 0.178 0.180 0.182 0.184 0.186 0.188 0.190 0.192 0.194 0.196 0.198 0.200 0.202 0.204 0.206 0.208 0.210 0.212 0.214 0.216 0.218 0.220 0.222 0.224 0.226 0.228 0.230 0.232 0.234 0.236 0.238 0.240 0.242 0.244 0.246 0.248 0.250 0.252 0.254 0.256 0.258 0.260 0.262 0.264 0.266 0.268 0.270 0.272 0.274 0.276 0.278 0.280 0.282 0.284 0.286 0.288 0.290 0.292 0.294 0.296 0.298 0.300 0.302 0.304 0.306 0.308 0.310 0.312 0.314 0.316 0.318 0.320 0.322 0.324 0.326 0.328 0.330 0.332 0.334 0.336 0.338 0.340 0.342 0.344 0.346 0.348 0.350 0.352 0.354 0.356 0.358 0.360 0.362 0.364 0.366 0.368 0.370 0.372 0.374 0.376 0.378 0.380 0.382 0.384 0.386 0.388 0.390 0.392 0.394 0.396 0.398 0.400 0.0 0.5 Density Residual Density Plot Model -2 0 2 4 6 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 -2.00 -1.95 -1.90 -1.85 -1.80 -1.75 -1.70 -1.65 -1.60 -1.55 -1.50 -1.45 -1.40 -1.35 -1.30 -1.25 -1.20 -1.15 -1.10 -1.05 -1.00 -0.95 -0.90 -0.85 -0.80 -0.75 -0.70 -0.65 -0.60 -0.55 -0.50 -0.45 -0.40 -0.35 -0.30 -0.25 -0.20 -0.15 -0.10 -0.05 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00 4.05 4.10 4.15 4.20 4.25 4.30 4.35 4.40 4.45 4.50 4.55 4.60 4.65 4.70 4.75 4.80 4.85 4.90 4.95 5.00 5.05 5.10 5.15 5.20 5.25 5.30 5.35 5.40 5.45 5.50 5.55 5.60 5.65 5.70 5.75 5.80 5.85 5.90 5.95 6.00 -2 0 2 4 6 4.4601332763067856.363800447292338 3.76115504364583143.062045709484215 3.3498014779179283.0105423165734537 3.0561723066757682.8350413864394532 2.82702173803468872.8188047773443197 2.63863192436287572.7886126069360713 2.47835038139411172.6318544382550066 2.3386241047809242.6104726072058644 2.21458069952942262.531095350804379 2.10289281128793172.2690497268720144 2.0011866833066642.1882711812622273 1.90770915195508531.999712228981558 1.82112839221424761.91874346078513 1.74040871470607161.6763777587048263 1.66472866159498921.6195121502937422 1.59342558861797051.456843052612893 1.5259570760342231.437133827276505 1.46187338495437681.4271656954875807 1.4007973692459461.3413587564443878 1.34240954465879311.3322279042355667 1.286436803136521.3281840614639826 1.23264375342004181.3221981927515687 1.18082598652791761.213756200390419 1.1308047739172591.1705432351682985 1.0824228469266321.1620683316571834 1.03554100266518431.070903144625296 0.99003534888497590.9949482476153595 0.94579504812176250.9327929633895885 0.90272045571787980.8579158227096552 0.86072157134788170.8219522923633503 0.81971674210637220.7770218708329992 0.77963156896602630.7301485048922944 0.74039797877169680.7074084554082097 0.70195343181485980.675351373993138 0.66424024107815760.628348203322031 0.62720498391670960.6095949148340426 0.59079799058799020.5571965312603285 0.55497289690214890.5109492173464416 0.51968625052212340.5050138605308755 0.484897162233682950.45133919022844116 0.4505669949317370.38489406515196295 0.41665908420794070.3819885775538488 0.38313848533436830.34802875677366296 0.349971742163310060.31505483599367873 0.317126674037999270.3033296166235613 0.284572177258899770.28825563569144125 0.252278037994252360.28725693793260276 0.220214753775749840.2699366412832012 0.188353360890017780.2632190961944195 0.15666526506962940.24576289679725896 0.12512207290578850.14829311630973957 0.093695421347091150.05692551630839277 0.062356802509743070.04128114538577092 0.031077380794769570.02866345369982355 -0.000172201027409151850.022574954193935216 -0.0314220305661232840.0049888288264924 -0.062703153811317087.562280616020336e-5 -0.0940478276166991-0.0876734200637166 -0.12548980295897538-0.12499947259241315 -0.15706464665642553-0.13979064981872144 -0.18881011104995418-0.18127838803921195 -0.2207665635449173-0.22290851019077393 -0.252977491085749-0.2527725296118838 -0.2854900988761303-0.2794066298411257 -0.3183560283794268-0.28647070454173484 -0.35163222744065326-0.313493773691975 -0.3853820161538522-0.3336098122754727 -0.41967640719693133-0.3568578885160971 -0.4545957608180757-0.3971164529279753 -0.4902318856783737-0.4446611629838116 -0.5266907424247111-0.4722319347731255 -0.5640959754919254-0.6041745463906791 -0.6025936041314849-0.6267602815521953 -0.6423583700532355-0.6495204732084621 -0.6836025091934652-0.6705649384139337 -0.7265881683562-0.7099001236709751 -0.7716454773187587-0.7203832787851066 -0.8191997255191584-0.7960018937186771 -0.8698138523268775-0.8011616519594088 -0.9242580958084321-1.0251890099853318 -0.9836310677952794-1.0589053776799409 -1.0495866689583666-1.1245354037943818 -1.1248041857239925-1.3339768662285565 -1.214109997913178-1.3462707073815343 -1.3278070777488553-1.367941520423741 -1.4964725796851872-1.6926269574647068 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? -2 0 2 4 6 8 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 -2.00 -1.95 -1.90 -1.85 -1.80 -1.75 -1.70 -1.65 -1.60 -1.55 -1.50 -1.45 -1.40 -1.35 -1.30 -1.25 -1.20 -1.15 -1.10 -1.05 -1.00 -0.95 -0.90 -0.85 -0.80 -0.75 -0.70 -0.65 -0.60 -0.55 -0.50 -0.45 -0.40 -0.35 -0.30 -0.25 -0.20 -0.15 -0.10 -0.05 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00 4.05 4.10 4.15 4.20 4.25 4.30 4.35 4.40 4.45 4.50 4.55 4.60 4.65 4.70 4.75 4.80 4.85 4.90 4.95 5.00 5.05 5.10 5.15 5.20 5.25 5.30 5.35 5.40 5.45 5.50 5.55 5.60 5.65 5.70 5.75 5.80 5.85 5.90 5.95 6.00 6.05 6.10 6.15 6.20 6.25 6.30 6.35 6.40 6.45 6.50 6.55 6.60 6.65 6.70 6.75 6.80 6.85 6.90 6.95 7.00 7.05 7.10 7.15 7.20 7.25 7.30 7.35 7.40 7.45 7.50 7.55 7.60 7.65 7.70 7.75 7.80 7.85 7.90 7.95 8.00 -5 0 5 10 Empirical Residual Quantile Plot Model 0.0 0.5 1.0 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.000 0.005 0.010 0.015 0.020 0.025 0.030 0.035 0.040 0.045 0.050 0.055 0.060 0.065 0.070 0.075 0.080 0.085 0.090 0.095 0.100 0.105 0.110 0.115 0.120 0.125 0.130 0.135 0.140 0.145 0.150 0.155 0.160 0.165 0.170 0.175 0.180 0.185 0.190 0.195 0.200 0.205 0.210 0.215 0.220 0.225 0.230 0.235 0.240 0.245 0.250 0.255 0.260 0.265 0.270 0.275 0.280 0.285 0.290 0.295 0.300 0.305 0.310 0.315 0.320 0.325 0.330 0.335 0.340 0.345 0.350 0.355 0.360 0.365 0.370 0.375 0.380 0.385 0.390 0.395 0.400 0.405 0.410 0.415 0.420 0.425 0.430 0.435 0.440 0.445 0.450 0.455 0.460 0.465 0.470 0.475 0.480 0.485 0.490 0.495 0.500 0.505 0.510 0.515 0.520 0.525 0.530 0.535 0.540 0.545 0.550 0.555 0.560 0.565 0.570 0.575 0.580 0.585 0.590 0.595 0.600 0.605 0.610 0.615 0.620 0.625 0.630 0.635 0.640 0.645 0.650 0.655 0.660 0.665 0.670 0.675 0.680 0.685 0.690 0.695 0.700 0.705 0.710 0.715 0.720 0.725 0.730 0.735 0.740 0.745 0.750 0.755 0.760 0.765 0.770 0.775 0.780 0.785 0.790 0.795 0.800 0.805 0.810 0.815 0.820 0.825 0.830 0.835 0.840 0.845 0.850 0.855 0.860 0.865 0.870 0.875 0.880 0.885 0.890 0.895 0.900 0.905 0.910 0.915 0.920 0.925 0.930 0.935 0.940 0.945 0.950 0.955 0.960 0.965 0.970 0.975 0.980 0.985 0.990 0.995 1.000 0 1 0.9982786763618190.9885057471264368 0.95428598801845490.9770114942528736 0.95192887862008470.9655172413793104 0.94297444562642160.9540229885057471 0.94206855817574310.9425287356321839 0.94034684435237360.9310344827586207 0.93058214989552850.9195402298850575 0.92913633253048230.9080459770114943 0.92351169699500190.896551724137931 0.90175681515075410.8850574712643678 0.89394556069938610.8735632183908046 0.87338899830150620.8620689655172413 0.863474169717530.8505747126436781 0.82940202329747960.8390804597701149 0.82037373558070160.8275862068965517 0.79217687037519090.8160919540229885 0.78851187798465880.8045977011494253 0.7866371757955850.7931034482758621 0.76990347764971930.7816091954022989 0.76805902971813960.7701149425287356 0.7672381947167930.7586206896551724 0.76601867318352910.7471264367816092 0.74298509747484410.735632183908046 0.73330146591761160.7241379310344828 0.73136804999501680.7126436781609196 0.7098519364052770.7011494252873564 0.69091216297202150.6896551724137931 0.67472284410304530.6781609195402298 0.65439446829527480.6666666666666666 0.64431171405554890.6551724137931034 0.63142681256704820.6436781609195402 0.61764746482254850.632183908045977 0.61084015404253090.6206896551724138 0.60110987088037290.6091954022988506 0.58656472357833620.5977011494252874 0.58067095966733620.5862068965517241 0.56393703296653060.5747126436781609 0.54885233284504330.5632183908045977 0.54689567844174620.5517241379310345 0.52899578355690320.5402298850574713 0.50635224098159980.5287356321839081 0.50535059199187560.5172413793103449 0.493575930187916350.5057471264367817 0.48203003351859980.4942528735632184 0.477899087904313740.4827586206896552 0.472569737232640730.47126436781609193 0.472215930244750340.45977011494252873 0.46606607520889380.4482758620689655 0.46367403364209970.4367816091954023 0.457440872447815950.42528735632183906 0.422241286510530060.41379310344827586 0.38881002244282830.40229885057471265 0.3830616577955760.39080459770114945 0.37842270305452850.3793103448275862 0.3761836013221090.367816091954023 0.36971472112884690.3563218390804598 0.367907261247085840.3448275862068966 0.335668383971412960.3333333333333333 0.32201799321929910.3218390804597701 0.316626316094546560.3103448275862069 0.30157128683324230.2988505747126437 0.286588974844012860.28735632183908044 0.27593488780621690.27586206896551724 0.26650961973167490.26436781609195403 0.264022974764334840.25287356321839083 0.254565541951929150.2413793103448276 0.247585739218453980.22988505747126436 0.23958840624388040.21839080459770116 0.22593020675108770.20689655172413793 0.21014415454256530.19540229885057472 0.201177180523012670.1839080459770115 0.160455085154081160.1724137931034483 0.153886879914346660.16091954022988506 0.147397465207664560.14942528735632185 0.141516118563081660.13793103448275862 0.130838947409636560.12643678160919541 0.12806455807746820.11494252873563218 0.108972388743922080.10344827586206896 0.107729940469485430.09195402298850575 0.061567428941815910.08045977011494253 0.055954678313491120.06896551724137931 0.046015079350792090.05747126436781609 0.0224579629522302230.04597701149425287 0.0214277846138345960.034482758620689655 0.0196976057053062750.022988505747126436 0.0043667503807110160.011494252873563218 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? 0.0 0.5 1.0 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.000 0.005 0.010 0.015 0.020 0.025 0.030 0.035 0.040 0.045 0.050 0.055 0.060 0.065 0.070 0.075 0.080 0.085 0.090 0.095 0.100 0.105 0.110 0.115 0.120 0.125 0.130 0.135 0.140 0.145 0.150 0.155 0.160 0.165 0.170 0.175 0.180 0.185 0.190 0.195 0.200 0.205 0.210 0.215 0.220 0.225 0.230 0.235 0.240 0.245 0.250 0.255 0.260 0.265 0.270 0.275 0.280 0.285 0.290 0.295 0.300 0.305 0.310 0.315 0.320 0.325 0.330 0.335 0.340 0.345 0.350 0.355 0.360 0.365 0.370 0.375 0.380 0.385 0.390 0.395 0.400 0.405 0.410 0.415 0.420 0.425 0.430 0.435 0.440 0.445 0.450 0.455 0.460 0.465 0.470 0.475 0.480 0.485 0.490 0.495 0.500 0.505 0.510 0.515 0.520 0.525 0.530 0.535 0.540 0.545 0.550 0.555 0.560 0.565 0.570 0.575 0.580 0.585 0.590 0.595 0.600 0.605 0.610 0.615 0.620 0.625 0.630 0.635 0.640 0.645 0.650 0.655 0.660 0.665 0.670 0.675 0.680 0.685 0.690 0.695 0.700 0.705 0.710 0.715 0.720 0.725 0.730 0.735 0.740 0.745 0.750 0.755 0.760 0.765 0.770 0.775 0.780 0.785 0.790 0.795 0.800 0.805 0.810 0.815 0.820 0.825 0.830 0.835 0.840 0.845 0.850 0.855 0.860 0.865 0.870 0.875 0.880 0.885 0.890 0.895 0.900 0.905 0.910 0.915 0.920 0.925 0.930 0.935 0.940 0.945 0.950 0.955 0.960 0.965 0.970 0.975 0.980 0.985 0.990 0.995 1.000 0 1 Empirical Residual Probability Plot

The diagnostic plots consist in the residual probability plot (upper left panel), the residual quantile plot (upper right panel) and the residual density plot (lower left panel) of the standardized data (see Chapter 6 of Coles, 2001). These plots can be displayed separately using respectively the probplot, qqplot, histplot and returnlevelplot functions.

Return level estimation

Since the model parameters vary in time, the quantiles also vary in time. Therefore, a T-year return level can be estimated for each year. This set of return levels are referred to as effective return levels as proposed by Katz et al. (2002).

The 100-year effective return levels for the fm₂ model can be computed using the returnlevel function:

julia> r = returnlevel(fm₂, 100)ReturnLevel
returnperiod :	100
value :		Vector{Float64}[86]

The effective return levels can be accessed as follows:

julia> r.value86-element Vector{Float64}:
 1.7489936832950526
 1.8187096516756003
 1.7984714314312729
 1.756426135156674
 1.7972477277971095
 1.8238280461015437
 1.821580663582192
 1.7053913088046657
 1.8154503678412175
 1.8240398484206768
 ⋮
 1.9663703427333037
 1.8867078403064839
 1.9160807180310273
 1.9618089027782744
 1.9677391737702747
 1.9562237839380565
 1.895642473037726
 2.0176954238909266
 2.013267333768548

The corresponding confidence interval can be computed with the cint function:

julia> c = cint(r)86-element Vector{Vector{Real}}:
 [1.6464829066065283, 1.8515044599835768]
 [1.7251036134260933, 1.9123156899251073]
 [1.7048688798346274, 1.8920739830279183]
 [1.6550379488049871, 1.8578143215083607]
 [1.7037278450906306, 1.8907676105035884]
 [1.7317757216930512, 1.9158803705100362]
 [1.7297984243804045, 1.9133629027839796]
 [1.5809572007674173, 1.8298254168419141]
 [1.723770734795733, 1.907130000886702]
 [1.7329937388835963, 1.9150859579577573]
 ⋮
 [1.859790953836958, 2.0729497316296497]
 [1.7587332274998884, 2.0146824531130796]
 [1.797245351179525, 2.03491608488253]
 [1.8523402194326652, 2.0712775861238835]
 [1.858201200934169, 2.0772771466063804]
 [1.8440901683740472, 2.068357399502066]
 [1.7646548289729513, 2.0266301171025005]
 [1.9073298034620776, 2.1280610443197756]
 [1.9027214984142238, 2.123813169122872]

The effective return levels along with their confidence intervals can be plotted as follows:

rmin = [c[i][1] for i in eachindex(c)]
rmax = [c[i][2] for i in eachindex(c)]
df = DataFrame(Year = data[:,:Year], r = r.value, rmin = rmin, rmax = rmax)
set_default_plot_size(12cm, 9cm)
plot(df, x=:Year, y=:r, ymin=:rmin, ymax=rmax, Geom.line, Geom.ribbon,
    Coord.cartesian(xmin=1895, xmax=1990), Guide.xticks(ticks=1895:10:1990),
    Guide.ylabel("100-year Effective Return Level"))
Year 1895 1905 1915 1925 1935 1945 1955 1965 1975 1985 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? 1.4 1.6 1.8 2.0 2.2 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 1.400 1.405 1.410 1.415 1.420 1.425 1.430 1.435 1.440 1.445 1.450 1.455 1.460 1.465 1.470 1.475 1.480 1.485 1.490 1.495 1.500 1.505 1.510 1.515 1.520 1.525 1.530 1.535 1.540 1.545 1.550 1.555 1.560 1.565 1.570 1.575 1.580 1.585 1.590 1.595 1.600 1.605 1.610 1.615 1.620 1.625 1.630 1.635 1.640 1.645 1.650 1.655 1.660 1.665 1.670 1.675 1.680 1.685 1.690 1.695 1.700 1.705 1.710 1.715 1.720 1.725 1.730 1.735 1.740 1.745 1.750 1.755 1.760 1.765 1.770 1.775 1.780 1.785 1.790 1.795 1.800 1.805 1.810 1.815 1.820 1.825 1.830 1.835 1.840 1.845 1.850 1.855 1.860 1.865 1.870 1.875 1.880 1.885 1.890 1.895 1.900 1.905 1.910 1.915 1.920 1.925 1.930 1.935 1.940 1.945 1.950 1.955 1.960 1.965 1.970 1.975 1.980 1.985 1.990 1.995 2.000 2.005 2.010 2.015 2.020 2.025 2.030 2.035 2.040 2.045 2.050 2.055 2.060 2.065 2.070 2.075 2.080 2.085 2.090 2.095 2.100 2.105 2.110 2.115 2.120 2.125 2.130 2.135 2.140 2.145 2.150 2.155 2.160 2.165 2.170 2.175 2.180 2.185 2.190 2.195 2.200 1.4 1.6 1.8 2.0 2.2 100-year Effective Return Level

Bayesian Inference

Most functions described in the previous sections also work in the Bayesian context. To reproduce exactly the results, the seed should be fixed as follows:

import Random
Random.seed!(4786)

Most functions described in the previous sections also work in the Bayesian context.

GEV parameter estimation

The Bayesian GEV parameter estimation is performed with the gevfitbayes function:

julia> fm = gevfitbayes(data, :SeaLevel, locationcovid = [:Year, :SOI])
Progress:   6%|██▍                                      |  ETA: 0:00:02
Progress:  11%|████▌                                    |  ETA: 0:00:02
Progress:  19%|███████▉                                 |  ETA: 0:00:01
Progress:  27%|███████████                              |  ETA: 0:00:01
Progress:  35%|██████████████▎                          |  ETA: 0:00:01
Progress:  42%|█████████████████▍                       |  ETA: 0:00:01
Progress:  50%|████████████████████▍                    |  ETA: 0:00:01
Progress:  58%|███████████████████████▋                 |  ETA: 0:00:01
Progress:  65%|██████████████████████████▉              |  ETA: 0:00:00
Progress:  73%|██████████████████████████████           |  ETA: 0:00:00
Progress:  80%|█████████████████████████████████        |  ETA: 0:00:00
Progress:  88%|████████████████████████████████████▎    |  ETA: 0:00:00
Progress:  96%|███████████████████████████████████████▌ |  ETA: 0:00:00
Progress: 100%|█████████████████████████████████████████| Time: 0:00:01
BayesianAbstractExtremeValueModel
model :
	BlockMaxima{GeneralizedExtremeValue}
	data :		Vector{Float64}[86]
	location :	μ ~ 1 + Year + SOI
	logscale :	ϕ ~ 1
	shape :		ξ ~ 1

sim :
	MambaLite.Chains
	Iterations :		2001:5000
	Thinning interval :	1
	Chains :		1
	Samples per chain :	3000
	Value :			Array{Float64, 3}[3000,5,1]
Prior

Currently, only the improper uniform prior is implemented, i.e. \[ f_{(β₁,β₂,β₃)}(β₁,β₂,β₃) ∝ 1. \]

Inference for the non-stationary Gumbel distribution

The package aslo provides functions for the inference of the non-stationary Gumbel model. Documentation on the Gumbel model can be found here in the Block Maxima section.

Example on the annual maximum sea-levels recorded at Fremantle

The location parameter varying as a linear function of the year and the SOI

julia> fm₂ = gumbelfit(data, :SeaLevel, locationcovid = [:Year, :SOI])MaximumLikelihoodAbstractExtremeValueModel
model :
	BlockMaxima{Gumbel}
	data :		Vector{Float64}[86]
	location :	μ ~ 1 + Year + SOI
	logscale :	ϕ ~ 1

θ̂  :	[-3.112447859214716, 0.002358975977102567, 0.045892020491916104, -2.147213954852745]

Confidence intervals for the parameters are obtained with the cint function:

julia> cint(fm₂)4-element Vector{Vector{Float64}}:
 [-4.825555304377321, -1.3993404140521108]
 [0.0014786231231302162, 0.0032393288310749177]
 [0.011612282486563964, 0.08017175849726824]
 [-2.306675317663155, -1.987752592042335]

The diagnostic plots for assessing the accuracy of the Gumbel model fitted to the Fremantle data can be shown with the diagnosticplots function:

set_default_plot_size(21cm ,16cm)
diagnosticplots(fm₂)
h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? Data -2.5 0.0 2.5 5.0 7.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 -1.95 -1.90 -1.85 -1.80 -1.75 -1.70 -1.65 -1.60 -1.55 -1.50 -1.45 -1.40 -1.35 -1.30 -1.25 -1.20 -1.15 -1.10 -1.05 -1.00 -0.95 -0.90 -0.85 -0.80 -0.75 -0.70 -0.65 -0.60 -0.55 -0.50 -0.45 -0.40 -0.35 -0.30 -0.25 -0.20 -0.15 -0.10 -0.05 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00 4.05 4.10 4.15 4.20 4.25 4.30 4.35 4.40 4.45 4.50 4.55 4.60 4.65 4.70 4.75 4.80 4.85 4.90 4.95 5.00 5.05 5.10 5.15 5.20 5.25 5.30 5.35 5.40 5.45 5.50 5.55 5.60 5.65 5.70 5.75 5.80 5.85 5.90 5.95 6.00 6.05 6.10 6.15 6.20 6.25 6.30 6.35 6.40 6.45 6.50 6.55 6.60 6.65 6.70 6.75 6.80 6.85 6.90 6.95 -2.5 0.0 2.5 5.0 7.5 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? 0.0 0.1 0.2 0.3 0.4 0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20 0.22 0.24 0.26 0.28 0.30 0.32 0.34 0.36 0.38 0.40 0.000 0.002 0.004 0.006 0.008 0.010 0.012 0.014 0.016 0.018 0.020 0.022 0.024 0.026 0.028 0.030 0.032 0.034 0.036 0.038 0.040 0.042 0.044 0.046 0.048 0.050 0.052 0.054 0.056 0.058 0.060 0.062 0.064 0.066 0.068 0.070 0.072 0.074 0.076 0.078 0.080 0.082 0.084 0.086 0.088 0.090 0.092 0.094 0.096 0.098 0.100 0.102 0.104 0.106 0.108 0.110 0.112 0.114 0.116 0.118 0.120 0.122 0.124 0.126 0.128 0.130 0.132 0.134 0.136 0.138 0.140 0.142 0.144 0.146 0.148 0.150 0.152 0.154 0.156 0.158 0.160 0.162 0.164 0.166 0.168 0.170 0.172 0.174 0.176 0.178 0.180 0.182 0.184 0.186 0.188 0.190 0.192 0.194 0.196 0.198 0.200 0.202 0.204 0.206 0.208 0.210 0.212 0.214 0.216 0.218 0.220 0.222 0.224 0.226 0.228 0.230 0.232 0.234 0.236 0.238 0.240 0.242 0.244 0.246 0.248 0.250 0.252 0.254 0.256 0.258 0.260 0.262 0.264 0.266 0.268 0.270 0.272 0.274 0.276 0.278 0.280 0.282 0.284 0.286 0.288 0.290 0.292 0.294 0.296 0.298 0.300 0.302 0.304 0.306 0.308 0.310 0.312 0.314 0.316 0.318 0.320 0.322 0.324 0.326 0.328 0.330 0.332 0.334 0.336 0.338 0.340 0.342 0.344 0.346 0.348 0.350 0.352 0.354 0.356 0.358 0.360 0.362 0.364 0.366 0.368 0.370 0.372 0.374 0.376 0.378 0.380 0.382 0.384 0.386 0.388 0.390 0.392 0.394 0.396 0.398 0.400 0.0 0.5 Density Residual Density Plot Model -2 0 2 4 6 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 -2.00 -1.95 -1.90 -1.85 -1.80 -1.75 -1.70 -1.65 -1.60 -1.55 -1.50 -1.45 -1.40 -1.35 -1.30 -1.25 -1.20 -1.15 -1.10 -1.05 -1.00 -0.95 -0.90 -0.85 -0.80 -0.75 -0.70 -0.65 -0.60 -0.55 -0.50 -0.45 -0.40 -0.35 -0.30 -0.25 -0.20 -0.15 -0.10 -0.05 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00 4.05 4.10 4.15 4.20 4.25 4.30 4.35 4.40 4.45 4.50 4.55 4.60 4.65 4.70 4.75 4.80 4.85 4.90 4.95 5.00 5.05 5.10 5.15 5.20 5.25 5.30 5.35 5.40 5.45 5.50 5.55 5.60 5.65 5.70 5.75 5.80 5.85 5.90 5.95 6.00 -2 0 2 4 6 4.4601332763067854.420141706779488 3.76115504364583142.730548327965286 3.3498014779179282.674438202838349 3.0561723066757682.519582840972588 2.82702173803468872.5074479308734703 2.63863192436287572.440701715320772 2.47835038139411172.391656667412465 2.3386241047809242.296459522665843 2.21458069952942262.227231377408363 2.10289281128793172.1249885372298563 2.0011866833066641.97984208772979 1.90770915195508531.8457054025398851 1.82112839221424761.8403091951426347 1.74040871470607161.717042630394002 1.66472866159498921.5106990953337316 1.59342558861797051.460906562001966 1.5259570760342231.4092099812937742 1.46187338495437681.3904341564129103 1.4007973692459461.3481444917063334 1.34240954465879311.3103401865935003 1.286436803136521.2700873127756018 1.23264375342004181.2647725630419069 1.18082598652791761.2120226517197505 1.1308047739172591.16873479107433 1.0824228469266321.16525851425713 1.03554100266518431.0623621277488597 0.99003534888497591.0094492042899645 0.94579504812176250.9043584581751172 0.90272045571787980.8941167086147048 0.86072157134788170.8640780170196557 0.81971674210637220.8268469481125538 0.77963156896602630.8052930876346017 0.74039797877169680.7645158715710421 0.70195343181485980.7618359741373742 0.66424024107815760.7422195220355537 0.62720498391670960.707634542509477 0.59079799058799020.683216445838625 0.55497289690214890.595352566622087 0.51968625052212340.5157619626691484 0.484897162233682950.50228885314476 0.4505669949317370.5022244262243541 0.41665908420794070.47325924432625655 0.38313848533436830.4124398191315459 0.349971742163310060.4120850799809816 0.317126674037999270.39862400483381466 0.284572177258899770.3498793586971595 0.252278037994252360.34489098348023817 0.220214753775749840.3277304883380703 0.188353360890017780.27182138247021775 0.15666526506962940.2688527673988274 0.12512207290578850.25477455845179675 0.093695421347091150.21753225246368565 0.062356802509743070.15952272608296653 0.031077380794769570.14212116291399074 -0.000172201027409151850.11129118511098066 -0.0314220305661232840.09685903430961501 -0.062703153811317080.026478973221820502 -0.09404782761669910.02478683194221078 -0.125489802958975380.018894199880152337 -0.157064646656425530.007472616908564409 -0.188810111049954180.0019118027821392045 -0.2207665635449173-0.10558985515871452 -0.252977491085749-0.1502139703936724 -0.2854900988761303-0.18477138258218398 -0.3183560283794268-0.1963781016092145 -0.35163222744065326-0.23817563753032348 -0.3853820161538522-0.3507956720684166 -0.41967640719693133-0.37443951327445146 -0.4545957608180757-0.4055858728623793 -0.4902318856783737-0.4541178156060172 -0.5266907424247111-0.5705746597740149 -0.5640959754919254-0.5732258423306056 -0.6025936041314849-0.6054638898981521 -0.6423583700532355-0.6640474497808281 -0.6836025091934652-0.67281555511679 -0.7265881683562-0.7209167444651658 -0.7716454773187587-0.8046872130646439 -0.8191997255191584-0.8351186509326063 -0.8698138523268775-0.8508723206593855 -0.9242580958084321-1.0360395587975693 -0.9836310677952794-1.0764511488728608 -1.0495866689583666-1.1019233734539027 -1.1248041857239925-1.3338268314738386 -1.214109997913178-1.4588884185977635 -1.3278070777488553-1.5606162087758677 -1.4964725796851872-1.7828457100222685 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? -2 0 2 4 6 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 -2.00 -1.95 -1.90 -1.85 -1.80 -1.75 -1.70 -1.65 -1.60 -1.55 -1.50 -1.45 -1.40 -1.35 -1.30 -1.25 -1.20 -1.15 -1.10 -1.05 -1.00 -0.95 -0.90 -0.85 -0.80 -0.75 -0.70 -0.65 -0.60 -0.55 -0.50 -0.45 -0.40 -0.35 -0.30 -0.25 -0.20 -0.15 -0.10 -0.05 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00 4.05 4.10 4.15 4.20 4.25 4.30 4.35 4.40 4.45 4.50 4.55 4.60 4.65 4.70 4.75 4.80 4.85 4.90 4.95 5.00 5.05 5.10 5.15 5.20 5.25 5.30 5.35 5.40 5.45 5.50 5.55 5.60 5.65 5.70 5.75 5.80 5.85 5.90 5.95 6.00 -2 0 2 4 6 Empirical Residual Quantile Plot Model 0.0 0.5 1.0 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.000 0.005 0.010 0.015 0.020 0.025 0.030 0.035 0.040 0.045 0.050 0.055 0.060 0.065 0.070 0.075 0.080 0.085 0.090 0.095 0.100 0.105 0.110 0.115 0.120 0.125 0.130 0.135 0.140 0.145 0.150 0.155 0.160 0.165 0.170 0.175 0.180 0.185 0.190 0.195 0.200 0.205 0.210 0.215 0.220 0.225 0.230 0.235 0.240 0.245 0.250 0.255 0.260 0.265 0.270 0.275 0.280 0.285 0.290 0.295 0.300 0.305 0.310 0.315 0.320 0.325 0.330 0.335 0.340 0.345 0.350 0.355 0.360 0.365 0.370 0.375 0.380 0.385 0.390 0.395 0.400 0.405 0.410 0.415 0.420 0.425 0.430 0.435 0.440 0.445 0.450 0.455 0.460 0.465 0.470 0.475 0.480 0.485 0.490 0.495 0.500 0.505 0.510 0.515 0.520 0.525 0.530 0.535 0.540 0.545 0.550 0.555 0.560 0.565 0.570 0.575 0.580 0.585 0.590 0.595 0.600 0.605 0.610 0.615 0.620 0.625 0.630 0.635 0.640 0.645 0.650 0.655 0.660 0.665 0.670 0.675 0.680 0.685 0.690 0.695 0.700 0.705 0.710 0.715 0.720 0.725 0.730 0.735 0.740 0.745 0.750 0.755 0.760 0.765 0.770 0.775 0.780 0.785 0.790 0.795 0.800 0.805 0.810 0.815 0.820 0.825 0.830 0.835 0.840 0.845 0.850 0.855 0.860 0.865 0.870 0.875 0.880 0.885 0.890 0.895 0.900 0.905 0.910 0.915 0.920 0.925 0.930 0.935 0.940 0.945 0.950 0.955 0.960 0.965 0.970 0.975 0.980 0.985 0.990 0.995 1.000 0 1 0.98803957430364340.9885057471264368 0.93689549175534790.9770114942528736 0.93337750023021130.9655172413793104 0.92266119776999190.9540229885057471 0.9217549180886370.9425287356321839 0.91658569757299750.9310344827586207 0.91258138392654440.9195402298850575 0.9042816232152020.9080459770114943 0.89778330498938050.896551724137931 0.88742227644228840.8850574712643678 0.87101938891138320.8735632183908046 0.85392331122014650.8620689655172413 0.85319399713109250.8505747126436781 0.83560731384915720.8390804597701149 0.80191264796643810.8275862068965517 0.79292563895715070.8160919540229885 0.78322424091882710.8045977011494253 0.77960555146322270.7931034482758621 0.77126617645679560.7816091954022989 0.76358694583563470.7701149425287356 0.75517399248538940.7586206896551724 0.75404480090924450.7471264367816092 0.74260222593195540.735632183908046 0.73288984445478730.7241379310344828 0.7320971640918410.7126436781609196 0.70776836759176530.7011494252873564 0.69459964824867610.6896551724137931 0.667109219623720.6781609195402298 0.66433504052553630.6666666666666666 0.65610139659275290.6551724137931034 0.6456960852486790.6436781609195402 0.63957146693250910.632183908045977 0.6277839082317620.6206896551724138 0.62700009221987620.6091954022988506 0.62122861481237720.5977011494252874 0.61090822390588040.5862068965517241 0.6035115477173620.5747126436781609 0.57616100337659160.5632183908045977 0.55043550056120380.5517241379310345 0.54599580432429910.5402298850574713 0.54597451700743490.5287356321839081 0.53634989099158180.5172413793103449 0.51580162390589080.5057471264367817 0.51568048113101240.4942528735632184 0.51107289972199790.4827586206896552 0.49422069559766180.47126436781609193 0.49248190242291380.45977011494252873 0.486481116991304750.4482758620689655 0.46673653109175310.4367816091954023 0.46568037500690880.42528735632183906 0.46066175934573690.41379310344827586 0.44731078507086680.40229885057471265 0.426326159922075560.39080459770114945 0.41999345996640630.3793103448275862 0.408739112166570830.367816091954023 0.40345757092235810.3563218390804598 0.37761938035408310.3448275862068966 0.376997079175609540.3333333333333333 0.37482981727156910.3218390804597701 0.37062843776755640.3103448275862069 0.3685827536823370.2988505747126437 0.32910910337137270.28735632183908044 0.312833910250739030.27586206896551724 0.30030898184207650.26436781609195403 0.29612104777022530.25287356321839083 0.281131697421396150.2413793103448276 0.241666377263741130.22988505747126436 0.233592732416857160.21839080459770116 0.22308974198043960.20689655172413793 0.207052370398512820.19540229885057472 0.17045507692775930.1839080459770115 0.169656340849250460.1724137931034483 0.16007674774412950.16091954022988506 0.143325189452064880.14942528735632185 0.140894015162469020.13793103448275862 0.12792418893434250.12643678160919541 0.106885511987981520.11494252873563218 0.099750068863888640.10344827586206896 0.096165110420176810.09195402298850575 0.0597232297800787060.08045977011494253 0.053170696983849190.06896551724137931 0.0492941573342613740.05747126436781609 0.0224707565331060230.04597701149425287 0.013552614976512870.034482758620689655 0.008550593559911080.022988505747126436 0.0026143099351889250.011494252873563218 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? 0.0 0.5 1.0 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.000 0.005 0.010 0.015 0.020 0.025 0.030 0.035 0.040 0.045 0.050 0.055 0.060 0.065 0.070 0.075 0.080 0.085 0.090 0.095 0.100 0.105 0.110 0.115 0.120 0.125 0.130 0.135 0.140 0.145 0.150 0.155 0.160 0.165 0.170 0.175 0.180 0.185 0.190 0.195 0.200 0.205 0.210 0.215 0.220 0.225 0.230 0.235 0.240 0.245 0.250 0.255 0.260 0.265 0.270 0.275 0.280 0.285 0.290 0.295 0.300 0.305 0.310 0.315 0.320 0.325 0.330 0.335 0.340 0.345 0.350 0.355 0.360 0.365 0.370 0.375 0.380 0.385 0.390 0.395 0.400 0.405 0.410 0.415 0.420 0.425 0.430 0.435 0.440 0.445 0.450 0.455 0.460 0.465 0.470 0.475 0.480 0.485 0.490 0.495 0.500 0.505 0.510 0.515 0.520 0.525 0.530 0.535 0.540 0.545 0.550 0.555 0.560 0.565 0.570 0.575 0.580 0.585 0.590 0.595 0.600 0.605 0.610 0.615 0.620 0.625 0.630 0.635 0.640 0.645 0.650 0.655 0.660 0.665 0.670 0.675 0.680 0.685 0.690 0.695 0.700 0.705 0.710 0.715 0.720 0.725 0.730 0.735 0.740 0.745 0.750 0.755 0.760 0.765 0.770 0.775 0.780 0.785 0.790 0.795 0.800 0.805 0.810 0.815 0.820 0.825 0.830 0.835 0.840 0.845 0.850 0.855 0.860 0.865 0.870 0.875 0.880 0.885 0.890 0.895 0.900 0.905 0.910 0.915 0.920 0.925 0.930 0.935 0.940 0.945 0.950 0.955 0.960 0.965 0.970 0.975 0.980 0.985 0.990 0.995 1.000 0 1 Empirical Residual Probability Plot

The 100-year effective return levels for the fm₂ model can be computed using the returnlevel function:

julia> r = returnlevel(fm₂, 100)ReturnLevel
returnperiod :	100
value :		Vector{Float64}[86]

The effective return levels can be accessed as follows:

julia> r.value86-element Vector{Float64}:
 1.8691213924827486
 1.9283864738698273
 1.9119297214452446
 1.8771161608238944
 1.9120584713502575
 1.9355921517061487
 1.9342797660438973
 1.8370530575535422
 1.930278234104639
 1.9386675476981967
 ⋮
 2.1007765495184634
 2.0342974947576913
 2.059602480980752
 2.0986750733513877
 2.1042464907629244
 2.0951324616170472
 2.044715614028447
 2.148037035087765
 2.1448889686058377

The corresponding confidence interval can be computed with the cint function:

julia> c = cint(r)86-element Vector{Vector{Real}}:
 [1.7583457823872852, 1.9798970025782119]
 [1.8180216271016414, 2.038751320638013]
 [1.8037675690928139, 2.0200918737976754]
 [1.7676627712661332, 1.9865695503816556]
 [1.8048195914347755, 2.0192973512657395]
 [1.8275998081282645, 2.043584495284033]
 [1.827056655321212, 2.0415028767665824]
 [1.7161554213121801, 1.9579506937949043]
 [1.8244859886440883, 2.03607047956519]
 [1.833241669248867, 2.0440934261475263]
 ⋮
 [2.0000054363435025, 2.2015476626934243]
 [1.9265267632441145, 2.142068226271268]
 [1.9566630009071906, 2.1625419610543135]
 [1.9977907834878426, 2.1995593632149326]
 [2.002961830717341, 2.2055311508085076]
 [1.9939002689389977, 2.1963646542950968]
 [1.9356352812226434, 2.1537959468342502]
 [2.0402732588868613, 2.255800811288669]
 [2.0381263835124295, 2.251651553699246]

The effective return levels along with their confidence intervals can be plotted as follows:

rmin = [c[i][1] for i in eachindex(c)]
rmax = [c[i][2] for i in eachindex(c)]
df = DataFrame(Year = data[:,:Year], r = r.value, rmin = rmin, rmax = rmax)
set_default_plot_size(12cm, 9cm)
plot(df, x=:Year, y=:r, ymin=:rmin, ymax=rmax, Geom.line, Geom.ribbon,
    Coord.cartesian(xmin=1895, xmax=1990), Guide.xticks(ticks=1895:10:1990),
    Guide.ylabel("100-year Effective Return Level"))
Year 1895 1905 1915 1925 1935 1945 1955 1965 1975 1985 h,j,k,l,arrows,drag to pan i,o,+,-,scroll,shift-drag to zoom r,dbl-click to reset c for coordinates ? for help ? 1.7 1.8 1.9 2.0 2.1 2.2 2.3 1.675 1.700 1.725 1.750 1.775 1.800 1.825 1.850 1.875 1.900 1.925 1.950 1.975 2.000 2.025 2.050 2.075 2.100 2.125 2.150 2.175 2.200 2.225 2.250 2.275 2.300 1.700 1.702 1.704 1.706 1.708 1.710 1.712 1.714 1.716 1.718 1.720 1.722 1.724 1.726 1.728 1.730 1.732 1.734 1.736 1.738 1.740 1.742 1.744 1.746 1.748 1.750 1.752 1.754 1.756 1.758 1.760 1.762 1.764 1.766 1.768 1.770 1.772 1.774 1.776 1.778 1.780 1.782 1.784 1.786 1.788 1.790 1.792 1.794 1.796 1.798 1.800 1.802 1.804 1.806 1.808 1.810 1.812 1.814 1.816 1.818 1.820 1.822 1.824 1.826 1.828 1.830 1.832 1.834 1.836 1.838 1.840 1.842 1.844 1.846 1.848 1.850 1.852 1.854 1.856 1.858 1.860 1.862 1.864 1.866 1.868 1.870 1.872 1.874 1.876 1.878 1.880 1.882 1.884 1.886 1.888 1.890 1.892 1.894 1.896 1.898 1.900 1.902 1.904 1.906 1.908 1.910 1.912 1.914 1.916 1.918 1.920 1.922 1.924 1.926 1.928 1.930 1.932 1.934 1.936 1.938 1.940 1.942 1.944 1.946 1.948 1.950 1.952 1.954 1.956 1.958 1.960 1.962 1.964 1.966 1.968 1.970 1.972 1.974 1.976 1.978 1.980 1.982 1.984 1.986 1.988 1.990 1.992 1.994 1.996 1.998 2.000 2.002 2.004 2.006 2.008 2.010 2.012 2.014 2.016 2.018 2.020 2.022 2.024 2.026 2.028 2.030 2.032 2.034 2.036 2.038 2.040 2.042 2.044 2.046 2.048 2.050 2.052 2.054 2.056 2.058 2.060 2.062 2.064 2.066 2.068 2.070 2.072 2.074 2.076 2.078 2.080 2.082 2.084 2.086 2.088 2.090 2.092 2.094 2.096 2.098 2.100 2.102 2.104 2.106 2.108 2.110 2.112 2.114 2.116 2.118 2.120 2.122 2.124 2.126 2.128 2.130 2.132 2.134 2.136 2.138 2.140 2.142 2.144 2.146 2.148 2.150 2.152 2.154 2.156 2.158 2.160 2.162 2.164 2.166 2.168 2.170 2.172 2.174 2.176 2.178 2.180 2.182 2.184 2.186 2.188 2.190 2.192 2.194 2.196 2.198 2.200 2.202 2.204 2.206 2.208 2.210 2.212 2.214 2.216 2.218 2.220 2.222 2.224 2.226 2.228 2.230 2.232 2.234 2.236 2.238 2.240 2.242 2.244 2.246 2.248 2.250 2.252 2.254 2.256 2.258 2.260 2.262 2.264 2.266 2.268 2.270 2.272 2.274 2.276 2.278 2.280 2.282 2.284 2.286 2.288 2.290 2.292 2.294 2.296 2.298 2.300 2.302 1.5 2.0 2.5 100-year Effective Return Level