theopwms | R Documentation |
Compute the theoretical probability-weighted moments (PWMs) for a distribution. A theoretical PWM in integral form is
\beta_r = \int^1_0 x(F)\,F^r\,\mathrm{d}F \mbox{,}
where x(F)
is the quantile function of the random variable X
for nonexceedance probability F
and r
represents the order of the PWM. This function loops across the above equation for each nmom
set in the argument list. The function x(F)
is computed through the par2qua
function. The distribution type is determined using the type
attribute of the para
argument, which is a parameter object of lmomco (see vec2par
).
theopwms(para, nmom=5, minF=0, maxF=1, quafunc=NULL,
nsim=50000, fold=5,
silent=TRUE, verbose=FALSE, ...)
para |
A distribution parameter object such as that by |
nmom |
The number of moments to compute. Default is 5. |
minF |
The end point of nonexceedance probability in which to perform the integration. Try setting to non-zero (but small) if you have a divergent integral. |
maxF |
The end point of nonexceedance probability in which to perform the integration. Try setting to non-unity (but close) if you have a divergent integral. |
quafunc |
An optional and arbitrary quantile function that simply needs to except a nonexceedance probability and the parameter object in |
nsim |
Simulation size for Monte Carlo integration is such is internally deemed necessary (see |
fold |
The number of fractions or number of folds of |
silent |
The argument of |
verbose |
Toggle verbose output. Because the R function |
... |
Additional arguments to pass. |
An R list
is returned.
betas |
The PWMs. Note that convention is the have a |
nsim |
Echo of the |
folds |
Echo of the |
monte_carlo |
A logical vector of whether one or more Monte Carlo integrations was needed for the |
source |
An attribute identifying the computational source of the probability-weighted moments: “theopwms”. |
integrations |
If |
W.H. Asquith
Hosking, J.R.M., 1990, L-moments–Analysis and estimation of distributions using linear combinations of order statistics: Journal of the Royal Statistical Society, Series B, v. 52, p. 105–124.
theoLmoms
, pwm
, pwm2lmom
para <- vec2par(c(0,1),type='nor') # standard normal
the.pwms <- theopwms(para) # compute PWMs
str(the.pwms)
## Not run:
# This example has a divergent integral triggered on the beta0. Monte Carlo (MC)
# integration is thus triggered. The verbose=TRUE saves numerical or MC
# integration result table to the return.
para <- vec2par(c(2,2, 1.8673636098392308, -0.1447286792099476), type="kap")
pwmkap <- lmom2pwm( lmomkap(para) )
print(pwmkap$betas) # 0.1155903 1.2153105 0.9304619 0.7282926 0.5938137
pwmthe <- theopwms(para, nmom=5, verbose=TRUE)
print(pwmthe$betas) # 0.1235817 1.2153104 0.9304619 0.7282926 0.5938137
para <- vec2par(c(2,2, 0.9898362024687231, -0.5140894097276032), type="kap")
pwmkap <- lmom2pwm( lmomkap(para) )
print(pwmkap$betas) # -0.06452787 1.33177963 1.06818379 0.85911124 0.71308145
pwmthe <- theopwms(para, nmom=5, verbose=TRUE)
print(pwmthe$betas) # -0.06901669 1.33177952 1.06818379 0.85911123 0.71308144
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.