| regsimh {lmomRFA} | R Documentation |
Simulate the distribution of heterogeneity and goodness-of-fit measures
Description
Estimates, using Monte Carlo simulation, the distribution of
heterogeneity and goodness-of-fit measures for regional frequency analysis.
These are the statistics H and Z^{\rm DIST}
defined respectively in sections 4.3.3 and 5.2.3 of Hosking and Wallis (1997).
Usage
regsimh(qfunc, para, cor = 0, nrec, nrep = 500, nsim = 500)
Arguments
qfunc |
List containing the quantile functions for each site. Can also be a single quantile function, which will be used for each site. |
para |
Parameters of the quantile functions at each site.
If |
cor |
Specifies the correlation matrix of the frequency distribution of each site's data. Can be a matrix (which will be rescaled to a correlation matrix if necessary) or a constant (which will be taken as the correlation between each pair of sites). |
nrec |
Numeric vector containing the record lengths at each site. |
nrep |
Number of simulated regions. |
nsim |
Number of simulations used, within each of the |
Details
A realization is generated of data simulated from
the region specified by parameters qfunc, para, and cor,
and with record lengths at each site specified by argument nrec.
The simulation procedure is as described in Hosking and Wallis (1997),
Table 6.1, through step 3.1.2.
Heterogeneity and goodness-of-fit measures are computed
for the realization, using the same method as in function regtst.
The entire procedure is repeated nrep times, and the values
of the heterogeneity and goodness-of-fit measures are saved.
Average values, across all nrep realizations,
of the heterogeneity and goodness-of-fit measures are computed.
Value
An object of class "regsimh".
This is a list with the following components:
nrep |
The number of simulated regions (argument |
nsim |
The number of simulation used within each region
(argument |
results |
Matrix of dimension 8 |
means |
Vector of length 8, containing the mean values,
across the |
Author(s)
J. R. M. Hosking jrmhosking@gmail.com
References
Hosking, J. R. M., and Wallis, J. R. (1997).
Regional frequency analysis: an approach based on L-moments.
Cambridge University Press.
See Also
regtst for details of the
heterogeneity and goodness-of-fit measures.
Examples
## Not run:
data(Cascades) # A regional data set
rmom<-regavlmom(Cascades) # Regional average L-moments
# Set up an artificial region to be simulated:
# -- Same number of sites as Cascades
# -- Same record lengths as Cascades
# -- Mean 1 at every site (results do not depend on the site means)
# -- L-CV varies linearly across sites, with mean value equal
# to the regional average L-CV for the Cascades data.
# 'LCVrange' specifies the range of L-CV across the sites.
# -- L-skewness the same at each site, and equal to the regional
# average L-skewness for the Cascades data
nsites <- nrow(Cascades)
means <- rep(1,nsites)
LCVrange <- 0.025
LCVs <- seq(rmom[2]-LCVrange/2, rmom[2]+LCVrange/2, len=nsites)
Lskews<-rep(rmom[3], nsites)
# Each site will have a generalized normal distribution:
# get the parameter values for each site
pp <- t(apply(cbind(means, means*LCVs ,Lskews), 1, pelgno))
# Set correlation between each pair of sites to 0.64, the
# average inter-site correlation for the Cascades data
avcor <- 0.64
# Run the simulation. It will take some time (about 25 sec
# on a Lenovo W500, a moderately fast 2011-vintage laptop)
# Note that the results are consistent with the statement
# "the average H value of simulated regions is 1.08"
# in Hosking and Wallis (1997, p.98).
set.seed(123)
regsimh(qfunc=quagno, para=pp, cor=avcor, nrec=Cascades$n,
nrep=100)
## End(Not run)