Description Usage Arguments Value Author(s) References See Also Examples
Recompute parametric Gfactors (gfactor
; G^\mathrm{type}_f) from L-moment lmoments$
data frames for por
, by_year
, and by_decade
. Also recompute empirical Gfactors (gfactor_emp
; G^\mathrm{emp}_f) from the table
data frame. Specifically, the function modifies the gfactor
and gfactor_emp
columns in the output structure of akqdecay
. The Gfactor specifically is G_f(F;Θ_\mathrm{type}) for nonexceedance probability F \in [0,1] and parameters Θ for a given type of distribution computed by the method of L-moments (Asquith, 2018). This function is a wrapper (abstraction layer) on lmrdf2gfactor
and serves as a means for updating the R environment
from fill_akqenv
. The gfredo
function can thus be used to avoid recalling fill_akqenv
as a means to update the G_f estimation but avoids a huge amount of redundant computation—there is no need to recompute the L-moments, for example.
1 2 |
akqenv |
The R |
f |
Nonexceedance probability (F \in [0,1]), and the default is the 90th percentile; |
type |
Distribution type of the lmomco package to estimate the G_f for the probability |
which |
The style or type of L-moment storage. This argument is named similarly to the |
all |
A logical and if set, each of the |
showdiffsum |
This function computes new G_f and as a result, it might be useful to review the effect of the change in G_f from old to new. This argument triggers a simple |
setgfna |
If set, then Gfactor ( |
silent |
Suppress informative calls to R |
... |
Additional arguments to pass (see source code to ascertain flexible usage). |
This function is intended to be used for its side effects on the akenv
. Though if that argument is an R data.frame
then that after G_f modification is returned.
W.H. Asquith
Asquith, W.H., 2018, lmomco—L-moments, trimmed L-moments, L-comoments, censored
L-moments, and many distributions: R package version 2.3.2 at https://cran.r-project.org/package=lmomco
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ## Not run:
# USGS 11502500 Williamson River below Sprague River near Chiloquin, Oregon
AK <- akqdecay(dvget("11502500", sdate="1920-01-01", edate="2015-12-31"))
AK <- gfredo(AK, f=0.80, type="gpa", showdiffsum=TRUE)
# Min. 1st Qu. Median Mean 3rd Qu. Max.
# 25.65 48.81 74.29 108.30 177.40 276.20
# Min. 1st Qu. Median Mean 3rd Qu. Max.
# 43.44 64.18 96.26 119.10 182.40 219.00
# Min. 1st Qu. Median Mean 3rd Qu. Max.
# 132.2 132.2 132.2 132.2 132.2 132.2
# The 132.2 is the day change from old to new for period of record. #
## End(Not run)
## Not run:
sites <- c("05403500", "05405000") # Two streamgages in Wisconsin
WisExample <- new.env(); fill_dvenv( sites, envir=WisExample,
sdate="1945-01-01", edate="2015-12-31")
WisAKQ <- new.env(); fill_akqenv(dvenv=WisExample, envir=WisAKQ, type="gev")
# Note that the generalized extreme value distribution is used (gev).
gfredo(WisAKQ, f=0.95, all=FALSE, showdiffsum=TRUE) # 95th percentile
# Recomputing gfactors for 05403500 (1/2) for por -- got'em
# Min. 1st Qu. Median Mean 3rd Qu. Max.
# -61.48 -61.48 -61.48 -61.48 -61.48 -61.48
# Recomputing gfactors for 05405000 (2/2) -- got'em
# Min. 1st Qu. Median Mean 3rd Qu. Max.
# -87.71 -87.71 -87.71 -87.71 -87.71 -87.71
gfredo(WisAKQ, f=0.95, all=FALSE, which="year") # now redo the years
gfredo(WisAKQ, f=0.95, all=FALSE, which="decade") # now redo the decades
# Better yet, let the function by default redo all three to the 89th percentile.
# but convert back to the generalized Pareto distribution.
gfredo(WisAKQ, f=0.89, all=TRUE, type="gpa", silent=TRUE) #
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.