Learn R Programming

lmomco (version 2.4.14)

theopwms: The Theoretical Probability-Weighted Moments using Integration of the Quantile Function

Description

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).

Usage

theopwms(para, nmom=5, minF=0, maxF=1, quafunc=NULL,
               nsim=50000, fold=5,
               silent=TRUE, verbose=FALSE, ...)

Value

An R

list is returned.

betas

The PWMs. Note that convention is the have a \(\beta_0\), but this is placed in the first index i=1 of the betas vector.

nsim

Echo of the nsim argument if and only if at least one Monte Carlo integration was required, otherwise this is set to “not needed” on the return.

folds

Echo of the folds argument if and only if at least one Monte Carlo integration was required, otherwise this is set to “not needed” on the return.

monte_carlo

A logical vector of whether one or more Monte Carlo integrations was needed for the r-th index of the vector during the integrations for the \(r\)-th PWM (beta).

source

An attribute identifying the computational source of the probability-weighted moments: “theopwms”.

integrations

If verbose=TRUE, then the results of the integrations are a data frame stored here. Otherwise, integrations is not present in the list.

Arguments

para

A distribution parameter object such as that by lmom2par or vec2par.

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 para. This is a feature that permits computation of the PWMs of a quantile function that does not have to be implemented in the greater overhead hassles of the lmomco style. This feature might be useful for estimation of quantile function mixtures or those distributions not otherwise implemented in this package.

nsim

Simulation size for Monte Carlo integration is such is internally deemed necessary (see silent argument).

fold

The number of fractions or number of folds of nsim, which in other words, means that nsim is divided by folds and a loop creating folds integrations of nsim/folds is used from which the mean and mean absolute error of the integrand are computed. This is to try to recover similar output as integrate().

silent

The argument of silent for the try() operation wrapped on integrate(). If set true and the integral is probability divergent, Monte Carlo integration is triggered using nsim and folds. The user would have to set verbose=TRUE to then acquire the returned table in integrations of the integration passes including those are or are not Monte Carlo.

verbose

Toggle verbose output. Because the R function integrate is used to perform the numerical integration, it might be useful to see selected messages regarding the numerical integration.

...

Additional arguments to pass.

Author

W.H. Asquith

References

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.

See Also

theoLmoms, pwm, pwm2lmom