genci.simple | R Documentation |
This function estimates the lower and upper limits of a specified confidence interval for a vector of nonexceedance probabilities F
of a specified parent distribution [quantile function Q(F,\theta)
with parameters \theta
] using Monte Carlo simulation. The F
are specified by the user. The user also provides \Theta
of the parent distribution (see lmom2par
). This function is a wrapper on qua2ci.simple
; please consult the documentation for that function for further details of the simulations.
genci.simple(para, n, f=NULL, level=0.90, edist="gno", nsim=1000,
expand=FALSE, verbose=FALSE, showpar=FALSE, quiet=FALSE)
para |
The parameters from |
n |
The sample size for each Monte Carlo simulation will use. |
f |
Vector of nonexceedance probabilities ( |
level |
The confidence interval ( |
edist |
The model for the error distribution. Although the Normal (the default) commonly is assumed in error analyses, it need not be, as support for other distributions supported by lmomco is available. The default is the Generalized Normal so the not only is the Normal possible but asymmetry is also accomodated ( |
nsim |
The number of simulations (replications) for the sample size |
expand |
Should the returned values be expanded to include information relating to the distribution type and L-moments of the distribution at the corresponding nonexceedance probabilities—in other words the information necessary to reconstruct the reported confidence interval. The default is |
verbose |
The verbosity of the operation of the function. This argument is passed unused to |
showpar |
The parameters of the |
quiet |
Suppress incremental counter for a count down of the |
An R data.frame
or list
is returned (see discussion of argument expand
). The following elements could be available.
nonexceed |
A vector of |
lwr |
The lower value of the confidence interval having nonexceedance probability equal to |
true |
The true quantile value from |
upr |
The upper value of the confidence interval having |
lscale |
The second L-moment (L-scale, |
parent |
The paraments of the parent distribution if |
edist |
The type of error distribution used to model the confidence interval if the argument |
elmoms |
The L-moment of the distribution of quantiles for the corresponding |
epara |
An environment containing the parameter lists of the error distribution fit to the |
ifail |
A failure integer. |
ifailtext |
Text message associated with |
W.H. Asquith
genci
, gen.freq.curves
## Not run:
# For all these examples, nsim is way too small.
mean <- 0; sigma <- 100
parent <- vec2par(c(mean,sigma), type='nor') # make parameter object
f <- c(0.5, 0.8, 0.9, 0.96, 0.98, 0.99) # nonexceed probabilities
# nsim is small for speed of example not accuracy.
CI <- genci.simple(parent, n=10, f=f, nsim=20); FF <- CI$nonexceed
plot( FF, CI$true, type='l', lwd=2)
lines(FF, CI$lwr, col=2); lines(FF, CI$upr, col=3)
pdf("twoCIplots.pdf")
# The qnorm() call has been added to produce "normal probability"
# paper on the horizonal axis. The parent is heavy-tailed.
GEV <- vec2par(c(10000,1500,-0.3), type='gev') # a GEV distribution
CI <- genci.simple(GEV, n=20, nsim=200, edist='gno')
ymin <- log10(min(CI$lwr[! is.na(CI$lwr)]))
ymax <- log10(max(CI$upr[! is.na(CI$upr)]))
qFF <- qnorm(CI$nonexceed)
plot( qFF, log10(CI$true), type='l', ylim=c(ymin,ymax),lwd=2)
lines(qFF, log10(CI$lwr), col=2); lines(qFF, log10(CI$upr), col=3)
# another error distribution model
CI <- genci.simple(GEV, n=20, nsim=200, edist='aep4')
lines(qFF,log10(CI$lwr),col=2,lty=2); lines(qFF,log10(CI$upr),col=3,lty=2)
dev.off() #
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.