GoTF: Goodness of tail fit (GoTF).

View source: R/All.R

GoTFR Documentation

Goodness of tail fit (GoTF).

Description

Provides two GoTF scores for the generalised extreme value (GEV), Gumbel, generalised Pareto (GenPareto), or generalised logistic (GenLog) distribution. Also for any simulated numeric distribution

Usage

GoTF(x, dist = "GenLog", pars = NULL, GF = NULL, RepDist = NULL)

Arguments

x

a numeric vector. The sample of interest

dist

a choice of distribution to be assessed. The choices are "GenLog", "GEV", "Gumbel", or "GenPareto". The default is "GenLog"

pars

numeric vector of parameters for the GEV, GenLog, Gumbel, or GenPareto distributions. In the order of location, scale, shape (excluding shape for Gumbel)

GF

numeric vector of length three which are the growth factor statistics & QMED, in the order of Lcv, Lskew, & QMED

RepDist

a simulated sample (ideally of size = 5000*n) of a representative distribution to compare to the sample of interest

Details

The closer the results are to one, the better the fit. The GoTF is calculated by simulating the sample 5000 times with the desired distribution and calculating a statistic (in this case the coefficient of variation (CV) & mean) for the upper 25 percent of each sample. The same is calculated for the subject sample and compared to the distribution. The number of statistics from the simulated samples that are greater than the sample statistics is divided by 5000. The GoTF is this latter number where it is <0.5 and 1 minus this latter number where is it >0.5. If any further distributions are of interest, the representative distribution (RepDist) argument can be used. In this case a simulation of 5000*length(x) from that distribution can be used as RepDist, in place of using the dist input. If a sample that is not equal to 5000 time length(x) is in the RepDist argument, it will be resampled with replacement. An alternative is to use the pars or GF arguments which simulate from the distribution choice (dist) based on the parameters (location, scale, shape) or the growth factor (GF) inputs; the median annual maximum flow (QMED), linear coefficient of variation (Lcv), and linear skewnes (LSkew). The resulting probabilities for each statistic (the GoTF score) represent the probability of observing that statistic if the sample distribution has the same underlying distribution as the one under scrutiny.

Value

A data.frame with one row of probabilities representing the GoTF. The first column is the Tail cv and the second is the tail mean.

Author(s)

Anthony Hammond

Examples

#Get an AMAX sample and derive GoTF score against the GenLog and the GEV distributions
AM <- GetAM(203018)
GoTF(AM$Flow, dist = "GenLog")
GoTF(AM$Flow, dist = "GEV")
#Derive the GF parameters for the ungauged pooled estimate for the AM and
#calculate a GoTF for GenLog (assuming the gauged QMED)
#For this assume 0.16 and 0.2 as the ungauged Lcv & LSkew pooled estimates
 GoTF(AM$Flow, GF = c(0.16, 0.2, median(AM$Flow)))
#calculate the GoTF based on parameters of the GenLog estimated inadequately.
Loc <- mean(AM$Flow)
Scale <- sd(AM$Flow)
Skew <- 1-(median(AM$Flow)/mean(AM$Flow))
GoTF(AM$Flow, pars = c(Loc, Scale, Skew))

UKFE documentation built on Nov. 6, 2023, 1:07 a.m.

Related to GoTF in UKFE...