The original Fortran routine by Hosking is here used to analyse a region.
1 2 3 4 5 6 7 8 9 10 11 12  HW.original (data, cod, Nsim=500)
## S3 method for class 'HWorig'
print(x, ...)
## S3 method for class 'HWorig'
plot(x, interactive=TRUE, ...)
LMR (PARA, distr="EXP")
PEL (XMOM, distr="EXP")
SAMLMR (X, A=0, B=0)
SAMLMU (X)
SAMPWM (X, A=0, B=0)
REGLMR (data, cod)
REGTST (data, cod, A=0, B=0, Nsim=500)

x 
object of class 
data 
vector representing data from many samples defined with 
cod 
array that defines the data subdivision among sites 
Nsim 
number of regions simulated with the bootstrap of the original region 
interactive 
logical: if TRUE the graphic showing is interactive 
... 
additional parameter for 
PARA 
parameters of the distribution (vector) 
distr 
distribution:

XMOM 
the Lmoment ratios of the distribution, in order λ_1, λ_2, τ_3, τ_4, τ_5... 
X 
a data vector 
A, B 
Parameters of plotting position: for unbiased estimates (of the λ's) set A=B=zero. Otherwise, plottingposition estimators are used, based on the plotting position (j+a)/(n+b) for the j'th smallest of n observations. For example, A=0.35 and B=0.0 yields the estimators recommended by Hosking et al. (1985, technometrics) for the GEV distribution. 
Documentation of the original Fortran routines by Hosking available at http://www.research.ibm.com/people/h/hosking/lmoments.html.
Differences among HW.original
and HW.tests
should depend on differences among PEL
and par.kappa
for the kappa distribution.
A numerical algorithm is used to resolve the implicit Equations (A.99) and (A.100) in Hosking and Wallis (1997, pag. 203204).
The algorithms in PEL
and par.kappa
are different.
Anyway the risults of the tests should converge asymptotically.
IBM software disclaimer
LMOMENTS: Fortran routines for use with the method of Lmoments
Permission to use, copy, modify and distribute this software for any purpose and without fee is hereby granted, provided that this copyright and permission notice appear on all copies of the software. The name of the IBM Corporation may not be used in any advertising or publicity pertaining to the use of the software. IBM makes no warranty or representations about the suitability of the software for any purpose. It is provided "AS IS" without any express or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and noninfringement. IBM shall not be liable for any direct, indirect, special or consequential damages resulting from the loss of use, data or projects, whether in an action of contract or tort, arising out of or in connection with the use or performance of this software.
HW.original
returns an object of class HWorig
(what the Fortran subroutine REGTST return).
LMR
calculates the Lmoment ratios of a distribution given its parameters.
PEL
calculates the parameters of a distribution given its Lmoments.
SAMLMR
calculates the sample Lmoments ratios of a dataset.
SAMLMU
calculates the ‘unbiased’ sample Lmoments ratios of a dataset.
SAMPWM
calculates the sample probability weighted moments of a dataset.
REGLMR
calculates regional weighted averages of the sample Lmoments ratios.
REGTST
calculates statistics useful in regional frequency analysis.
1) Discordancy measure, d(i), for individual sites in a region.
Large values might be used as a flag to indicate potential errors
in the data at the site. "large" might be 3 for regions with 15
or more sites, but less (exact values in array dc1) for smaller
regions.
2) Heterogeneity measures, H(j), for a region based upon either:
j=1: the weighted s.d. of the lcvs or
j=2: the average distance from the site to the regional average
on a graph of lcv vs. lskewness
j=3: the average distance from the site to the regional average
on a graph of lskewness vs. lkurtosis.
In practice H(1) is probably sufficient. a value greater than
(say) 1.0 suggests that further subdivision of the region should
be considered as it might improve quantile estimates.
3) Goodnessoffit measures, Z(k), for 5 candidate distributions:
k=1: generalized logistic
k=2: generalized extreme value
k=3: generalized normal (lognormal)
k=4: pearson type iii (3parameter gamma)
k=5: generalized pareto.
Provided that the region is acceptably close to homogeneous,
the fit may be judged acceptable at 10
if Z(k) is less than 1.645 in absolute value.
For further details see Hosking and Wallis (1997), "Regional frequency analysis: an approach based on Lmoments", cambridge university press, chapters 35.
For information on the package and the Author, and for all the references, see nsRFA
.
HW.tests
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  data(hydroSIMN)
annualflows
summary(annualflows)
x < annualflows["dato"][,]
cod < annualflows["cod"][,]
split(x,cod)
HW.original(x,cod)
fac < factor(annualflows["cod"][,],levels=c(34:38))
x2 < annualflows[!is.na(fac),"dato"]
cod2 < annualflows[!is.na(fac),"cod"]
HW.original(x2,cod2)
plot(HW.original(x2,cod2))

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.